diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp index a788e43b..e5249d4b 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.cpp @@ -109,8 +109,9 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key key, bool down) { m_subsheetEditor.close(); m_exportMenu.close(); } - auto pal = m_model.pal(); - if (pal) { + auto const popupOpen = m_subsheetEditor.isOpen() && m_exportMenu.isOpen(); + auto const pal = m_model.pal(); + if (pal && !popupOpen) { const auto colorCnt = pal->colors.size(); if (key == turbine::Key::Alpha_D) { m_tool = Tool::Draw; @@ -496,7 +497,7 @@ void TileSheetEditorImGui::ExportMenu::draw() noexcept { ImGui::SetNextWindowSize(ImVec2(235, popupHeight)); if (ImGui::BeginPopupModal(popupName, &m_show, modalFlags)) { ImGui::InputInt("Scale", &m_scale); - m_scale = ox::clamp(m_scale, 1, 20); + m_scale = ox::clamp(m_scale, 1, 50); if (ImGui::Button("OK", ImVec2{50, 20})) { ImGui::CloseCurrentPopup(); m_show = false; diff --git a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp index 8b747e15..2670ab3d 100644 --- a/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp +++ b/src/nostalgia/modules/core/src/studio/tilesheeteditor/tilesheeteditor-imgui.hpp @@ -41,6 +41,8 @@ class TileSheetEditorImGui: public studio::Editor { } void draw() noexcept; void close() noexcept; + [[nodiscard]] + inline bool isOpen() const noexcept { return m_show; } }; class ExportMenu { int m_scale = 0; @@ -53,6 +55,8 @@ class TileSheetEditorImGui: public studio::Editor { } void draw() noexcept; void close() noexcept; + [[nodiscard]] + inline bool isOpen() const noexcept { return m_show; } }; std::size_t m_selectedPaletteIdx = 0; turbine::Context &m_ctx;