From c4ab1ed292b10ce57b77f5c50dbb49ab9b3a1bd5 Mon Sep 17 00:00:00 2001 From: scawful Date: Fri, 26 Jan 2024 21:48:48 -0500 Subject: [PATCH] Change Overworld buttons to selectables based on EditingMode --- src/app/editor/overworld_editor.cc | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/app/editor/overworld_editor.cc b/src/app/editor/overworld_editor.cc index 7e3449e2..9d3e9512 100644 --- a/src/app/editor/overworld_editor.cc +++ b/src/app/editor/overworld_editor.cc @@ -216,43 +216,49 @@ absl::Status OverworldEditor::DrawToolset() { TEXT_COLUMN(ICON_MD_MORE_VERT) // Separator NEXT_COLUMN() - if (ImGui::Button(ICON_MD_DRAW)) { + if (ImGui::Selectable(ICON_MD_DRAW, + current_mode == EditingMode::DRAW_TILE)) { current_mode = EditingMode::DRAW_TILE; } HOVER_HINT("Draw Tile") NEXT_COLUMN() - if (ImGui::Button(ICON_MD_DOOR_FRONT)) { + if (ImGui::Selectable(ICON_MD_DOOR_FRONT, + current_mode == EditingMode::ENTRANCES)) { current_mode = EditingMode::ENTRANCES; } HOVER_HINT("Entrances") NEXT_COLUMN() - if (ImGui::Button(ICON_MD_DOOR_BACK)) { + if (ImGui::Selectable(ICON_MD_DOOR_BACK, + current_mode == EditingMode::EXITS)) { current_mode = EditingMode::EXITS; } HOVER_HINT("Exits") NEXT_COLUMN() - if (ImGui::Button(ICON_MD_GRASS)) { + if (ImGui::Selectable(ICON_MD_GRASS, current_mode == EditingMode::ITEMS)) { current_mode = EditingMode::ITEMS; } HOVER_HINT("Items") NEXT_COLUMN() - if (ImGui::Button(ICON_MD_PEST_CONTROL_RODENT)) { + if (ImGui::Selectable(ICON_MD_PEST_CONTROL_RODENT, + current_mode == EditingMode::SPRITES)) { current_mode = EditingMode::SPRITES; } HOVER_HINT("Sprites") NEXT_COLUMN() - if (ImGui::Button(ICON_MD_ADD_LOCATION)) { + if (ImGui::Selectable(ICON_MD_ADD_LOCATION, + current_mode == EditingMode::TRANSPORTS)) { current_mode = EditingMode::TRANSPORTS; } HOVER_HINT("Transports") NEXT_COLUMN() - if (ImGui::Button(ICON_MD_MUSIC_NOTE)) { + if (ImGui::Selectable(ICON_MD_MUSIC_NOTE, + current_mode == EditingMode::MUSIC)) { current_mode = EditingMode::MUSIC; } HOVER_HINT("Music") @@ -261,11 +267,13 @@ absl::Status OverworldEditor::DrawToolset() { if (ImGui::Button(ICON_MD_GRID_VIEW)) { show_tile16_editor_ = !show_tile16_editor_; } + HOVER_HINT("Tile16 Editor") TableNextColumn(); if (ImGui::Button(ICON_MD_TABLE_CHART)) { show_gfx_group = !show_gfx_group; } + HOVER_HINT("Gfx Group Editor") TEXT_COLUMN(ICON_MD_MORE_VERT) // Separator