summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-21 10:53:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-21 10:53:49 +0100
commit15bbfc100a79a975f6024d6e2e6522c4e91f2cb5 (patch)
tree1fa630728c14b0973a042b50ec712f1303b82eff /editor
parent5dbee173b961792b42596cb792a50624555cc41b (diff)
src, draw: work on depth and z offsets
Diffstat (limited to 'editor')
-rw-r--r--editor/imgui.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp
index 696460a7..51c690b2 100644
--- a/editor/imgui.cpp
+++ b/editor/imgui.cpp
@@ -130,8 +130,15 @@ bool app::check_inspector_exists(const popup_target& p)
void app::do_popup_menu()
{
- auto b0 = push_id(SCENERY_POPUP_NAME);
const auto [sc, target] = _popup_target;
+ if (target == popup_target_type::none || sc == nullptr)
+ {
+ _popup_target = {};
+ _pending_popup = {};
+ return;
+ }
+
+ auto b0 = push_id(SCENERY_POPUP_NAME);
//if (_popup_target.target != popup_target_type::scenery) {...}
if (_pending_popup)
@@ -144,8 +151,6 @@ void app::do_popup_menu()
if (auto b1 = begin_popup(SCENERY_POPUP_NAME))
{
- fm_assert(target != popup_target_type::none && sc != nullptr);
-
ImGui::SeparatorText("Setup");
const auto i = sc->index();
if (ImGui::MenuItem("Activate", nullptr, false, sc->can_activate(i)))