diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-02-23 17:22:32 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-02-23 17:22:32 +0100 |
| commit | ecacc4e197eb8da6c311dad6e37330bcbbfef86e (patch) | |
| tree | 4e9d6f70b93d2e53aa948eac6cd0aceff11f1fc5 /editor/imgui.cpp | |
| parent | 25e36ab269096f11ebb2a1c9f6cc3ab93f830b44 (diff) | |
wip
Diffstat (limited to 'editor/imgui.cpp')
| -rw-r--r-- | editor/imgui.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/editor/imgui.cpp b/editor/imgui.cpp index 69037861..c26e9987 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -2,6 +2,9 @@ #include "floormat/main.hpp" #include "compat/format.hpp" #include "imgui-raii.hpp" +#include "world.hpp" +#include "scenery.hpp" +#include "inspect.hpp" #include <Magnum/Math/Color.h> namespace floormat { @@ -109,6 +112,7 @@ void app::draw_ui() draw_editor_pane(main_menu_height); draw_fps(); draw_tile_under_cursor(); + draw_inspector(); ImGui::EndFrame(); } @@ -144,6 +148,21 @@ void app::draw_tile_under_cursor() {window_size[0]*.5f - size.x/2, 3*dpi[1]}, (unsigned)-1, buf); } +void app::draw_inspector() +{ + auto& w = M->world(); + if (cursor.tile) + { + auto [c, t] = w[*cursor.tile]; + if (auto s = t.scenery()) + { + ImGui::SetNextWindowSize({400, 0}); + auto b = begin_window("inspector"_s); + entities::inspect_type(s); + } + } +} + void app::draw_editor_pane(float main_menu_height) { auto* ed = _editor.current_tile_editor(); |
