From ecacc4e197eb8da6c311dad6e37330bcbbfef86e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 23 Feb 2023 17:22:32 +0100 Subject: wip --- editor/imgui.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'editor/imgui.cpp') 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 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(); -- cgit v1.2.3