blob: 9622fd79edff3565f9fd5a1bc8dc3f95693976ff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
|