summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-27 08:59:13 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-03-27 08:59:13 +0200
commitf6684418f22df4baaccdcda325cbe1beb8e6180a (patch)
treed463fc05e5ebdd4ac55fff249060c8f2cc2ac6c2 /editor
parentc27896540f0a1051183cb3f0de314f170d3c32c3 (diff)
editor: allow inspecting object id
Diffstat (limited to 'editor')
-rw-r--r--editor/inspect-types.cpp5
-rw-r--r--editor/inspect.cpp4
2 files changed, 9 insertions, 0 deletions
diff --git a/editor/inspect-types.cpp b/editor/inspect-types.cpp
index 22944a97..5b02acde 100644
--- a/editor/inspect-types.cpp
+++ b/editor/inspect-types.cpp
@@ -23,6 +23,11 @@ struct entity_accessors<scenery> {
{
using entity = Entity<scenery>;
return std::tuple{
+ entity::type<uint64_t>::field{"id"_s,
+ [](const scenery& x) { return x.id; },
+ [](scenery&, uint64_t) {},
+ constantly(field_status::readonly),
+ },
entity::type<StringView>::field{"atlas"_s,
[](const scenery& x) { return loader.strip_prefix(x.atlas->name()); },
[](scenery&, StringView) {},
diff --git a/editor/inspect.cpp b/editor/inspect.cpp
index 415dcdff..1631f11c 100644
--- a/editor/inspect.cpp
+++ b/editor/inspect.cpp
@@ -34,6 +34,8 @@ template<> struct IGDT_<uint16_t> : std::integral_constant<int, ImGuiDataType_U1
template<> struct IGDT_<int16_t> : std::integral_constant<int, ImGuiDataType_S16> {};
template<> struct IGDT_<uint32_t> : std::integral_constant<int, ImGuiDataType_U32> {};
template<> struct IGDT_<int32_t> : std::integral_constant<int, ImGuiDataType_S32> {};
+template<> struct IGDT_<uint64_t> : std::integral_constant<int, ImGuiDataType_U64> {};
+template<> struct IGDT_<int64_t> : std::integral_constant<int, ImGuiDataType_S64> {};
template<> struct IGDT_<float> : std::integral_constant<int, ImGuiDataType_Float> {};
template<typename T> constexpr auto IGDT = IGDT_<T>::value;
@@ -203,6 +205,8 @@ MAKE_SPEC_REPRS2(uint16_t)
MAKE_SPEC_REPRS2(int16_t)
MAKE_SPEC_REPRS2(uint32_t)
MAKE_SPEC_REPRS2(int32_t)
+MAKE_SPEC_REPRS2(uint64_t)
+MAKE_SPEC_REPRS2(int64_t)
MAKE_SPEC_REPRS2(float)
MAKE_SPEC(bool, field_repr::input)
MAKE_SPEC(String, field_repr::input)