summaryrefslogtreecommitdiff
path: root/kurator/src/inspect.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-02-17 00:58:41 +0100
committerAki <please@ignore.pl>2023-02-17 00:58:41 +0100
commit320b3d8252786c0b831414824643c41bed80bfd7 (patch)
tree38776a24df0af8d572d908fddeb62fc7ebb7bbae /kurator/src/inspect.cpp
parent69e4074e471bc7e2dcf285fb253bc70d0c8ffbf5 (diff)
downloadkurator-320b3d8252786c0b831414824643c41bed80bfd7.zip
kurator-320b3d8252786c0b831414824643c41bed80bfd7.tar.gz
kurator-320b3d8252786c0b831414824643c41bed80bfd7.tar.bz2
Ships markers can now be selected to show inspection window
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