diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-25 00:29:43 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-12-25 00:29:43 +0100 |
| commit | 8b7af89b78cacf2e171e2b73fc508704ea79c316 (patch) | |
| tree | ed0914b105530c682991eee6edeb4d50d1536e09 /editor | |
| parent | 56b5489bdea839eb24165a86e937a29b9a42a39f (diff) | |
main, editor: set cursor from imgui
Diffstat (limited to 'editor')
| -rw-r--r-- | editor/app.hpp | 1 | ||||
| -rw-r--r-- | editor/events.cpp | 5 | ||||
| -rw-r--r-- | editor/update.cpp | 2 |
3 files changed, 7 insertions, 1 deletions
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<tile_atlas>& 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 |
