52template<
typename TYPE>
56template<
typename TYPE, std::
size_t i = 0>
60 if constexpr (i < TYPE::Traits::num_fields)
69 using field_tuple =
typename TYPE::Traits::field_types;
70 using field_type =
typename std::tuple_element<i, field_tuple>::type;
74 ImGui::TableSetColumnIndex(0);
75 ImGui::AlignTextToFramePadding();
77 if (TYPE::Traits::field_descriptions[i] !=
nullptr)
79 if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
81 if (ImGui::BeginTooltip())
83 ImGui::TextDisabled(TYPE::Traits::field_typenames[i]);
84 ImGui::Text(TYPE::Traits::field_descriptions[i]);
89 ImGui::TableSetColumnIndex(1);
92 if constexpr (i < TYPE::Traits::num_fields - 1)
94 ImGui::TableNextRow();
104template<
typename TYPE>
108 if constexpr (
requires { &TYPE::Traits::num_fields; })
110 if constexpr (TYPE::Traits::num_fields > 0 && !std::is_enum<TYPE>())
Component inspection functions.
Definition componentinspection.h:29
Util::Array< DrawFunc > inspectors
Definition componentinspection.h:49
ComponentInspection()
Definition componentinspection.cc:88
static ComponentInspection * Singleton
Definition componentinspection.h:47
static void Register(ComponentId component, DrawFunc)
Definition componentinspection.cc:55
bool debug
Definition componentinspection.h:41
void(*)(Game::ComponentId, void *, bool *) DrawFunc
Definition componentinspection.h:31
static void DrawInspector(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:74
static void Destroy()
This static method is used to destroy the registry object and should be called right before the main ...
Definition componentinspection.cc:42
~ComponentInspection()
Definition componentinspection.cc:96
static ComponentInspection * Instance()
The registry's constructor is called by the Instance() method, and nobody else.
Definition componentinspection.cc:25
Nebula's dynamic array class.
Definition array.h:60
Game::EditorState.
Definition graphicsmanager.h:60
MemDb::AttributeId ComponentId
Definition componentid.h:15
void ComponentDrawFuncT< Game::Entity >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:106
void ComponentDrawFuncT< Math::mat4 >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:230
void ComponentDrawFuncT(ComponentId component, void *data, bool *commit)
Definition componentinspection.h:106
void ComponentDrawFuncT< bool >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:122
void ComponentDrawFuncT< Game::Position >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:288
void ComponentDrawFuncT< Util::StringAtom >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:200
void ComponentDrawFuncT< uint64 >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:174
void ComponentDrawFuncT< int64 >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:148
void ComponentDrawFuncT< int >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:135
void ComponentDrawFuncT< Math::vec4 >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:262
void ComponentDrawFuncT< Game::Orientation >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:305
void ComponentDrawFuncT< float >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:187
void InspectorDrawField(ComponentId component, void *data, bool *commit)
Definition componentinspection.h:58
void ComponentDrawFuncT< Math::quat >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:275
void ComponentDrawFuncT< Util::Color >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:357
void ComponentDrawFuncT< uint >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:161
void ComponentDrawFuncT< Game::Scale >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:322
void ComponentDrawFuncT< Math::vec3 >(ComponentId component, void *data, bool *commit)
Definition componentinspection.cc:249
Definition attributeid.h:19
Nebula's universal string class.
Definition string.h:50
void Capitalize()
convert first char of string to upper case
Definition string.cc:941
const char * AsCharPtr() const
return contents as character pointer
Definition string.h:542
void CamelCaseToWords()
insert spaces before each capital letter in the string.
Definition string.cc:951