From dc0e9b591bb43199fb50ce6250fcb51b03c86995 Mon Sep 17 00:00:00 2001 From: nowahue Date: Wed, 8 Apr 2026 01:43:03 +0200 Subject: [PATCH] Change in entity hierarchy naming --- application/uilayer.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/application/uilayer.cpp b/application/uilayer.cpp index 27bc2493..4e11dad6 100644 --- a/application/uilayer.cpp +++ b/application/uilayer.cpp @@ -496,12 +496,16 @@ void ui_layer::render_entity_hierarchy(ECWorld& world) for (auto entity : world.GetEntities()) { - char buf[64]; - std::snprintf(buf, sizeof(buf), "Entity %u", static_cast(entity)); + std::string buf; + buf.reserve(64); + if (world.HasComponent(entity)) + buf = world.GetComponent(entity) -> Name.ToString(); + else + buf = std::to_string(static_cast(entity)); const bool selected = (m_selected_entity == entity); - if (ImGui::Selectable(buf, selected)) + if (ImGui::Selectable(buf.c_str(), selected)) { m_selected_entity = entity; }