[nostalgia/core/studio] Make Edit Subsheet popup close on escape press
This commit is contained in:
parent
762804905a
commit
58b7f813cc
@ -87,6 +87,9 @@ void TileSheetEditorImGui::keyStateChanged(core::Key key, bool down) {
|
|||||||
if (!down) {
|
if (!down) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (key == core::Key::Escape) {
|
||||||
|
m_subsheetEditor.close();
|
||||||
|
}
|
||||||
auto pal = model()->pal();
|
auto pal = model()->pal();
|
||||||
if (pal) {
|
if (pal) {
|
||||||
const auto colorCnt = pal->colors.size();
|
const auto colorCnt = pal->colors.size();
|
||||||
@ -427,4 +430,8 @@ void TileSheetEditorImGui::SubSheetEditor::draw() noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TileSheetEditorImGui::SubSheetEditor::close() noexcept {
|
||||||
|
m_show = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,10 +40,11 @@ class TileSheetEditorImGui: public studio::BaseEditor {
|
|||||||
m_rows = rows;
|
m_rows = rows;
|
||||||
}
|
}
|
||||||
void draw() noexcept;
|
void draw() noexcept;
|
||||||
|
void close() noexcept;
|
||||||
};
|
};
|
||||||
std::size_t m_selectedPaletteIdx = 0;
|
std::size_t m_selectedPaletteIdx = 0;
|
||||||
Context *m_ctx = nullptr;
|
Context *m_ctx = nullptr;
|
||||||
ox::Vector<ox::String> m_paletteList{};
|
ox::Vector<ox::String> m_paletteList;
|
||||||
SubSheetEditor m_subsheetEditor;
|
SubSheetEditor m_subsheetEditor;
|
||||||
ox::String m_itemPath;
|
ox::String m_itemPath;
|
||||||
ox::String m_itemName;
|
ox::String m_itemName;
|
||||||
|
Loading…
Reference in New Issue
Block a user