Jazz2/Editor/Shell/TileSetApplyDialog.h file

Namespaces

namespace Jazz2
Root namespace of Jazz² Resurrection.
namespace Jazz2::Editor

Functions

void ShowApplyTileChangesDialog(IEditorContext& session, std::int32_t source = -1)
Shows a window to save the tiles changed in this level into their tile set.
auto ApplyTileChanges(IEditorContext& session, std::uint8_t source, StringView newName, bool withPalette = false) -> bool
Saves the tiles of a tile set changed in this level into a tile set, as an undoable step.
auto CountChangedTiles(IEditorContext& session, std::uint8_t source) -> std::int32_t
Returns how many tiles of a tile set, as TileRef::Source, the level changes.

Function documentation

void ShowApplyTileChangesDialog(IEditorContext& session, std::int32_t source = -1)

Shows a window to save the tiles changed in this level into their tile set.

The tiles changed only in this level (see ShowTileEditor()) become tiles of a tile set: of a new one the level then uses, or of the one they're from, which every level that uses it then shows. The level doesn't change them anymore afterwards. A tile set of the game isn't written over, a copy of it in the user content takes its place. source is the tile set chosen first, as TileRef::Source, or -1 for the first one with changed tiles.

bool ApplyTileChanges(IEditorContext& session, std::uint8_t source, StringView newName, bool withPalette = false)

Saves the tiles of a tile set changed in this level into a tile set, as an undoable step.

source is the tile set as TileRef::Source. With an empty newName, they're saved into the tile set itself, otherwise into a new tile set of that name, which the level then uses instead. With withPalette, the palette of the level becomes the palette of the default tile set, and the level doesn't have its own then. Returns false if nothing was saved. Undo puts the changes back into the level, but doesn't change the saved file back.