Add EditingMode to OverworldEditor

This commit is contained in:
scawful
2023-11-10 23:21:15 -05:00
parent b1f9e2e253
commit b21ac96841
2 changed files with 42 additions and 9 deletions

View File

@@ -62,15 +62,36 @@ absl::Status OverworldEditor::DrawToolset() {
for (const auto &name : kToolsetColumnNames)
ImGui::TableSetupColumn(name.data());
BUTTON_COLUMN(ICON_MD_UNDO) // Undo
BUTTON_COLUMN(ICON_MD_REDO) // Redo
TEXT_COLUMN(ICON_MD_MORE_VERT) // Separator
BUTTON_COLUMN(ICON_MD_ZOOM_OUT) // Zoom Out
BUTTON_COLUMN(ICON_MD_ZOOM_IN) // Zoom In
TEXT_COLUMN(ICON_MD_MORE_VERT) // Separator
BUTTON_COLUMN(ICON_MD_DRAW) // Draw Tile
BUTTON_COLUMN(ICON_MD_DOOR_FRONT) // Entrances
BUTTON_COLUMN(ICON_MD_DOOR_BACK) // Exits
NEXT_COLUMN()
if (ImGui::Button(ICON_MD_UNDO)) {
RETURN_IF_ERROR(Undo())
}
NEXT_COLUMN()
if (ImGui::Button(ICON_MD_REDO)) {
RETURN_IF_ERROR(Redo())
}
TEXT_COLUMN(ICON_MD_MORE_VERT) // Separator
BUTTON_COLUMN(ICON_MD_ZOOM_OUT) // Zoom Out
BUTTON_COLUMN(ICON_MD_ZOOM_IN) // Zoom In
TEXT_COLUMN(ICON_MD_MORE_VERT) // Separator
NEXT_COLUMN()
if (ImGui::Button(ICON_MD_DRAW)) {
current_mode = EditingMode::DRAW_TILE;
}
NEXT_COLUMN()
if (ImGui::Button(ICON_MD_DOOR_FRONT)) {
current_mode = EditingMode::ENTRANCES;
}
NEXT_COLUMN()
if (ImGui::Button(ICON_MD_DOOR_BACK)) {
current_mode = EditingMode::EXITS;
}
BUTTON_COLUMN(ICON_MD_GRASS) // Items
BUTTON_COLUMN(ICON_MD_PEST_CONTROL_RODENT) // Sprites
BUTTON_COLUMN(ICON_MD_ADD_LOCATION) // Transports

View File

@@ -102,6 +102,18 @@ class OverworldEditor : public Editor, public SharedROM {
absl::Status DrawExperimentalModal();
enum class EditingMode {
DRAW_TILE,
ENTRANCES,
EXITS,
ITEMS,
SPRITES,
TRANSPORTS,
MUSIC
};
EditingMode current_mode = EditingMode::DRAW_TILE;
int current_world_ = 0;
int current_map_ = 0;
int current_tile16_ = 0;