From 73fc95bc7bbdfe24e535f390f79d33fb809c0151 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 16 Mar 2023 18:14:23 +0100 Subject: fix popup --- editor/update.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'editor/update.cpp') diff --git a/editor/update.cpp b/editor/update.cpp index 470e8b9f..7b3198ee 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -55,9 +55,7 @@ void app::do_mouse_up_down(std::uint8_t button, bool is_down, int mods) update_cursor_tile(cursor.pixel); if (is_down && !cursor.in_imgui) - { _popup_target = {}; - } if (is_down && cursor.tile && !cursor.in_imgui) { @@ -74,7 +72,10 @@ void app::do_mouse_up_down(std::uint8_t button, bool is_down, int mods) // TODO it should open on mouseup if still on the same item as on mousedown else if (button == mouse_button_right) if (auto* cl = find_clickable_scenery(*cursor.pixel)) + { + _pending_popup = true; _popup_target = { .e = cl->e, .target = popup_target_type::scenery, }; + } break; case editor_mode::floor: case editor_mode::walls: -- cgit v1.2.3