From 105a1e5559e9d9b4ad162c614c8deae0bfec198e Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 2 Feb 2025 20:43:01 -0600 Subject: [PATCH] [nostalgia/core/studio/tilesheet] Rework operation ctrls into a dropbox --- .../tilesheeteditor/tilesheeteditor-imgui.cpp | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp index 6b8fc250..48c7583b 100644 --- a/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/modules/gfx/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp @@ -246,23 +246,31 @@ void TileSheetEditorImGui::draw(studio::StudioContext&) noexcept { //ig::ComboBox("##Operations", ox::Array{"Operations"}, i); } ImGui::EndChild(); - ImGui::BeginChild("OperationsBox", {0, 32}, true); + ImGui::BeginChild("OperationsBox", {0, 35}, ImGuiWindowFlags_NoTitleBar); { - auto constexpr btnSz = ImVec2{75, 16}; - if (ig::PushButton("Flip X", {55, 16})) { - oxLogError(m_model.flipX()); - } - ImGui::SameLine(); - if (ig::PushButton("Flip Y", {55, 16})) { - oxLogError(m_model.flipY()); - } - ImGui::SameLine(); - if (ig::PushButton("Rotate Left", {80, 16})) { - oxLogError(m_model.rotateLeft()); - } - ImGui::SameLine(); - if (ig::PushButton("Rotate Right", {80, 16})) { - oxLogError(m_model.rotateRight()); + size_t i{}; + if (ig::ComboBox("##Operations", ox::SpanView{{ + ox::CStringView{"Operations"}, + ox::CStringView{"Flip X"}, + ox::CStringView{"Flip Y"}, + ox::CStringView{"Rotate Left"}, + ox::CStringView{"Rotate Right"}, + }}, i)) { + switch (i) { + case 1: + oxLogError(m_model.flipX()); + break; + case 2: + oxLogError(m_model.flipY()); + break; + case 3: + oxLogError(m_model.rotateLeft()); + break; + case 4: + oxLogError(m_model.rotateRight()); + break; + default:; + } } } ImGui::EndChild();