Jazz2::Editor::DocumentViewState struct

How a level was seen and played in the editor the last time, for the editor only.

Kept in the editor-only chunk edoc (see Formats::LevelFile::IsEditorOnlyChunk()), so the exported level has none of it. The level opens where it was left — the same place, zoom, layer and view toggles — and is played the same way, with the same character, difficulty and players.

It's written whenever the level is saved, a change of it alone doesn't make the level unsaved.

Public static variables

static std::uint32_t Chunk constexpr
Tag of the chunk it's kept in.

Public static functions

static auto Read(const LevelDocument& document, DocumentViewState& state) -> bool
Reads it from a level, returns false if the level has none.

Public functions

void Write(LevelDocument& document) const
Writes it into a level.

Public variables

bool HasCamera
Whether the camera was saved.
Vector2f CameraCenter
Center of the view in the level in pixels.
float CameraZoom
Zoom of the view relative to how large the game shows the level, so it fits any window.
std::int32_t CurrentLayer
Layer being edited, -1 if not saved.
bool ShowGrid
Whether the grid is shown.
bool ShowEvents
Whether events are shown.
bool ShowPlayPath
Whether the path of the last play-test is shown.
bool FlatLayers
Whether all layers are drawn aligned to the level.
std::uint8_t MaskMode
How collision masks are shown, 0 not at all, 1 over the tiles, 2 instead of them.
bool HasPlaySettings
Whether the way the level is played was saved.
std::uint8_t PlayCharacter
Character to play with, see PlayerType.
std::uint8_t PlayDifficulty
Difficulty, see GameDifficulty.
std::uint8_t PlayGameMode
Game mode of multiplayer in local splitscreen, 0 alone.
std::uint8_t PlayPlayerCount
Players of multiplayer in local splitscreen.