summaryrefslogtreecommitdiff
path: root/kurator/src/inspect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kurator/src/inspect.cpp')
-rw-r--r--kurator/src/inspect.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/kurator/src/inspect.cpp b/kurator/src/inspect.cpp
new file mode 100644
index 0000000..9622fd7
--- /dev/null
+++ b/kurator/src/inspect.cpp
@@ -0,0 +1,41 @@
+#include "inspect.h"
+
+#include <utility>
+
+#include <entt/entity/handle.hpp>
+#include <imgui.h>
+
+#include <kurator/universe/UniqueIdentifier.h>
+
+
+namespace kurator
+{
+
+
+void
+InspectionWindow::show()
+{
+ if (!open)
+ return;
+ if (ImGui::Begin("Inspect", &open)) {
+ if (selected) {
+ const auto& identifier = selected.get<universe::UniqueIdentifier>();
+ ImGui::Text("Selected: %d", identifier.id);
+ }
+ else {
+ ImGui::Text("Nothing selected");
+ }
+ }
+ ImGui::End();
+}
+
+
+void
+InspectionWindow::select(entt::handle entity)
+{
+ selected = std::move(entity);
+ open = true;
+}
+
+
+} // namespace kurator