From c8dc14dd8e080143bf9fd70bfe74ceeba7d75ffd Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 30 Jul 2022 14:45:17 -0500 Subject: [PATCH] [nostalgia/core/studio] Add key binding to for switching tools in TileSheetEditor --- src/nostalgia/core/studio/tilesheeteditor-imgui.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nostalgia/core/studio/tilesheeteditor-imgui.cpp b/src/nostalgia/core/studio/tilesheeteditor-imgui.cpp index 17fdbd36..bba3938e 100644 --- a/src/nostalgia/core/studio/tilesheeteditor-imgui.cpp +++ b/src/nostalgia/core/studio/tilesheeteditor-imgui.cpp @@ -90,7 +90,15 @@ void TileSheetEditorImGui::keyStateChanged(core::Key key, bool down) { auto pal = model()->pal(); if (pal) { const auto colorCnt = pal->colors.size(); - if (key >= core::Key::Num_1 && key <= core::Key::Num_0 + colorCnt) { + if (key == core::Key::Alpha_D) { + m_tool = Tool::Draw; + model()->clearSelection(); + } else if (key == core::Key::Alpha_S) { + m_tool = Tool::Select; + } else if (key == core::Key::Alpha_F) { + m_tool = Tool::Fill; + model()->clearSelection(); + } else if (key >= core::Key::Num_1 && key <= core::Key::Num_9 && key <= core::Key::Num_0 + colorCnt) { auto idx = ox::min(static_cast(key - core::Key::Num_1), colorCnt - 1); m_tileSheetEditor.setPalIdx(idx); } else if (key == core::Key::Num_0 && colorCnt >= 10) {