diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-28 18:56:18 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-11-28 18:56:18 +0100 |
commit | 08b3cbc942dd880fed669226d2516ec4b07af0ea (patch) | |
tree | c210e0cc0213900f0b472c5e4e4650ad26e16c45 /editor | |
parent | 16911b659ac6555ada2ddec560eb82c8dd7b910f (diff) |
imgui: gray out 'rotate' when not placing something
Diffstat (limited to 'editor')
-rw-r--r-- | editor/imgui.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp index e5d9bd5a..9c60179f 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -46,7 +46,11 @@ float app::draw_main_menu() } if (auto b = begin_menu("Mode")) { - const bool can_rotate = _editor.current_tile_editor() ? _editor.current_tile_editor()->can_rotate() : false; + bool can_rotate = false; + if (auto* ed = _editor.current_tile_editor()) + can_rotate = ed->is_anything_selected(); + else if (auto* ed = _editor.current_scenery_editor()) + can_rotate = ed->is_anything_selected(); bool b_none = false, b_floor = false, b_walls = false, b_rotate = false, b_scenery = false; ImGui::MenuItem("Select", "1", &b_none); ImGui::MenuItem("Floor", "2", &b_floor); |