FindReplaceDialog.h file
Namespaces
- namespace Jazz2
- Root namespace of Jazz² Resurrection.
- namespace Jazz2::Editor
Classes
- struct Jazz2::Editor::EventFindOptions
- Which events Find and Replace finds, see ReplaceEvents().
Functions
- void ShowFindReplaceDialog(IEditorContext& session)
- Finds tiles or events of a kind and replaces them, or selects them.
-
auto ReplaceTiles(IEditorContext& session,
std::
int32_t layer, const TileRef& find, const TileRef& replace, bool anyFlip, bool onlySelected = false) -> std:: int32_t - Replaces a tile with another one in the layers of a level, as a step that can be undone.
-
auto MatchesEventFind(IEditorContext& session,
const EventFindOptions& find,
const Formats::EventRecord& event,
std::
uint32_t cell, std:: int32_t offGrid) -> bool - Returns whether an event, at a tile of the grid or off it by its index, is found.
-
auto CountFoundEvents(IEditorContext& session,
const EventFindOptions& find) -> std::
int32_t - Returns the number of events found, on the grid and off it.
-
auto ReplaceEvents(IEditorContext& session,
const EventFindOptions& find,
const Formats::EventRecord& replace,
bool keepParams = true) -> std::
int32_t - Replaces the events found with another event, as a step that can be undone.
-
auto ReplaceEvents(IEditorContext& session,
const EventFindOptions& find,
EventType replace,
bool keepParams = true) -> std::
int32_t -
auto ReplaceEvents(IEditorContext& session,
EventType find,
EventType replace) -> std::
int32_t
Function documentation
void ShowFindReplaceDialog(IEditorContext& session)
Finds tiles or events of a kind and replaces them, or selects them.
A tile is taken from the brush, and matches the same tile of the same tile set — flipped the same way, or any way. A replaced tile keeps how it was flipped and whether it was translucent. Events are found by their kind and the values of the parameters chosen, edited as the event properties edit them. A replaced one gets the parameters set for the new kind, or keeps those of the same name, and keeps its difficulties and flags.
std:: int32_t ReplaceTiles(IEditorContext& session,
std:: int32_t layer,
const TileRef& find,
const TileRef& replace,
bool anyFlip,
bool onlySelected = false)
Replaces a tile with another one in the layers of a level, as a step that can be undone.
All layers if layer is -1, with onlySelected only the selected tiles. Returns the number of tiles replaced.
std:: int32_t ReplaceEvents(IEditorContext& session,
const EventFindOptions& find,
const Formats::EventRecord& replace,
bool keepParams = true)
Replaces the events found with another event, as a step that can be undone.
They become replace and keep their difficulties and flags, with keepParams also the parameters of the same name and kind as the new kind has. Returns how many, or -1 if the sprite layer is locked or hidden, the events can't be changed then.
std:: int32_t ReplaceEvents(IEditorContext& session,
EventType find,
EventType replace)
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.