[nostalgia/core/studio] Add key binding to for switching tools in TileSheetEditor
This commit is contained in:
parent
275e9dbff1
commit
c8dc14dd8e
@ -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<std::size_t>(static_cast<uint32_t>(key - core::Key::Num_1), colorCnt - 1);
|
||||
m_tileSheetEditor.setPalIdx(idx);
|
||||
} else if (key == core::Key::Num_0 && colorCnt >= 10) {
|
||||
|
Loading…
Reference in New Issue
Block a user