diff --git a/src/app/editor/overworld_editor.cc b/src/app/editor/overworld_editor.cc index 6b970c76..e76d4d5b 100644 --- a/src/app/editor/overworld_editor.cc +++ b/src/app/editor/overworld_editor.cc @@ -131,13 +131,8 @@ absl::Status OverworldEditor::DrawToolset() { void OverworldEditor::DrawOverworldMapSettings() { if (ImGui::BeginTable("#mapSettings", 7, ow_map_flags, ImVec2(0, 0), -1)) { - ImGui::TableSetupColumn("##1stCol"); - ImGui::TableSetupColumn("##gfxCol"); - ImGui::TableSetupColumn("##palCol"); - ImGui::TableSetupColumn("##sprgfxCol"); - ImGui::TableSetupColumn("##sprpalCol"); - ImGui::TableSetupColumn("##msgidCol"); - ImGui::TableSetupColumn("##2ndCol"); + for (const auto &name : kOverworldSettingsColumnNames) + ImGui::TableSetupColumn(name.data()); ImGui::TableNextColumn(); ImGui::SetNextItemWidth(100.f); @@ -175,7 +170,7 @@ void OverworldEditor::DrawOverworldMapSettings() { ImGui::InputText("##msgid", spr_palette_, kMessageIdSize); ImGui::TableNextColumn(); - ImGui::Checkbox("Show grid", &opt_enable_grid); + ImGui::Checkbox("Show grid", &opt_enable_grid); // TODO ImGui::EndTable(); } } diff --git a/src/app/editor/overworld_editor.h b/src/app/editor/overworld_editor.h index 60acd4be..48aca883 100644 --- a/src/app/editor/overworld_editor.h +++ b/src/app/editor/overworld_editor.h @@ -19,11 +19,11 @@ namespace yaze { namespace app { namespace editor { -static constexpr unsigned int k4BPP = 4; -static constexpr unsigned int kByteSize = 3; -static constexpr unsigned int kMessageIdSize = 5; -static constexpr unsigned int kNumSheetsToLoad = 223; -static constexpr unsigned int kTile8DisplayHeight = 64; +static constexpr uint k4BPP = 4; +static constexpr uint kByteSize = 3; +static constexpr uint kMessageIdSize = 5; +static constexpr uint kNumSheetsToLoad = 223; +static constexpr uint kTile8DisplayHeight = 64; static constexpr float kInputFieldSize = 30.f; static constexpr absl::string_view kToolsetColumnNames[] = { @@ -32,11 +32,17 @@ static constexpr absl::string_view kToolsetColumnNames[] = { "#entranceTool", "#exitTool", "#itemTool", "#spriteTool", "#transportTool", "#musicTool", "#separator3", "#reloadTool"}; +static constexpr absl::string_view kOverworldSettingsColumnNames[] = { + "##1stCol", "##gfxCol", "##palCol", "##sprgfxCol", + "##sprpalCol", "##msgidCol", "##2ndCol"}; + class OverworldEditor { public: void SetupROM(ROM &rom); absl::Status Update(); + absl::Status Undo() { return absl::UnimplementedError("Undo"); } + private: absl::Status DrawToolset(); void DrawOverworldMapSettings(); @@ -55,8 +61,7 @@ class OverworldEditor { char spr_palette_[3] = ""; char message_id_[5] = ""; char staticgfx[16]; - bool isLoaded = false; - bool doneLoaded = false; + bool opt_enable_grid = true; bool all_gfx_loaded_ = false; bool map_blockset_loaded_ = false;