Skip to content

Commit

Permalink
Fixed bug with inspectors that wouldn't allow you to edit fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
fLindahl committed Mar 1, 2024
1 parent 33561b1 commit 93eda9d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions code/application/game/componentinspection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void
ComponentDrawFuncT<bool>(ComponentId component, void* data, bool* commit)
{
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);
ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::Checkbox("##input_data", (bool*)data))
*commit = true;
ImGui::PopID();
Expand All @@ -137,7 +137,7 @@ ComponentDrawFuncT<int>(ComponentId component, void* data, bool* commit)
{
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);

ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::InputInt("##input_data", (int*)data))
*commit = true;
ImGui::PopID();
Expand All @@ -152,7 +152,7 @@ ComponentDrawFuncT<uint>(ComponentId component, void* data, bool* commit)
{
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);

ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::InputInt("##input_data", (int*)data))
*commit = true;
ImGui::PopID();
Expand All @@ -167,7 +167,7 @@ ComponentDrawFuncT<float>(ComponentId component, void* data, bool* commit)
{
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);

ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::InputFloat("##float_input", (float*)data))
*commit = true;
ImGui::PopID();
Expand All @@ -181,7 +181,7 @@ void
ComponentDrawFuncT<Util::StringAtom>(ComponentId component, void* data, bool* commit)
{
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);
ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
ImGui::Text(((Util::StringAtom*)data)->Value());
if (ImGui::BeginDragDropTarget())
{
Expand All @@ -206,7 +206,7 @@ ComponentDrawFuncT<Math::mat4>(ComponentId component, void* data, bool* commit)
{
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);

ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::InputFloat4("##row0", (float*)data))
*commit = true;
if (ImGui::InputFloat4("##row1", (float*)data + 4))
Expand All @@ -227,7 +227,7 @@ ComponentDrawFuncT<Math::vec3>(ComponentId component, void* data, bool* commit)
{
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);

ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::InputFloat3("##vec", (float*)data))
*commit = true;
ImGui::PopID();
Expand All @@ -243,7 +243,7 @@ ComponentDrawFuncT<Game::Position>(ComponentId component, void* data, bool* comm
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);

ImGui::SameLine();
ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::InputFloat3("##pos", (float*)data))
*commit = true;
ImGui::PopID();
Expand All @@ -259,7 +259,7 @@ ComponentDrawFuncT<Game::Orientation>(ComponentId component, void* data, bool* c
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);

ImGui::SameLine();
ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::InputFloat4("##orient", (float*)data))
*commit = true;
ImGui::PopID();
Expand All @@ -275,7 +275,7 @@ ComponentDrawFuncT<Game::Scale>(ComponentId component, void* data, bool* commit)
MemDb::Attribute* desc = MemDb::AttributeRegistry::GetAttribute(component);

ImGui::SameLine();
ImGui::PushID(component.id + 0x125233);
ImGui::PushID(component.id + 0x125233 + reinterpret_cast<intptr_t>(data));
if (ImGui::InputFloat3("##scl", (float*)data))
*commit = true;
ImGui::PopID();
Expand Down

0 comments on commit 93eda9d

Please sign in to comment.