From 8b7af89b78cacf2e171e2b73fc508704ea79c316 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 25 Dec 2022 00:29:43 +0100 Subject: main, editor: set cursor from imgui --- editor/app.hpp | 1 + editor/events.cpp | 5 +++++ editor/update.cpp | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'editor') diff --git a/editor/app.hpp b/editor/app.hpp index ba1133d7..9385c2a9 100644 --- a/editor/app.hpp +++ b/editor/app.hpp @@ -96,6 +96,7 @@ private: void draw_editor_pane(float main_menu_height); void draw_editor_tile_pane_atlas(tile_editor& ed, StringView name, const std::shared_ptr& atlas); void draw_editor_scenery_pane(scenery_editor& ed); + void set_cursor_from_imgui(); void draw_cursor(); void init_imgui(Vector2i size); void draw_ui(); diff --git a/editor/events.cpp b/editor/events.cpp index 96f5c82c..cc1c0d7a 100644 --- a/editor/events.cpp +++ b/editor/events.cpp @@ -199,4 +199,9 @@ int app::get_key_modifiers() return fixup_mods(M->get_mods()); } +void app::set_cursor_from_imgui() +{ + _imgui.updateApplicationCursor(M->application()); +} + } // namespace floormat diff --git a/editor/update.cpp b/editor/update.cpp index 972af56e..3c8f45fe 100644 --- a/editor/update.cpp +++ b/editor/update.cpp @@ -167,7 +167,7 @@ void app::update(float dt) if ([[maybe_unused]] clickable_scenery* s = find_clickable_scenery(cursor.pixel)) M->set_cursor(std::uint32_t(Cursor::Hand)); else - M->set_cursor(std::uint32_t(Cursor::Arrow)); + set_cursor_from_imgui(); } } // namespace floormat -- cgit v1.2.3