From 5eac910d73b4310a8c7fcb4212882d7ff3b0cf80 Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Thu, 9 Apr 2026 01:31:34 +0200 Subject: [PATCH] Add name info into selected label --- application/uilayer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/application/uilayer.cpp b/application/uilayer.cpp index 4e11dad6..f979d284 100644 --- a/application/uilayer.cpp +++ b/application/uilayer.cpp @@ -500,7 +500,7 @@ void ui_layer::render_entity_hierarchy(ECWorld& world) buf.reserve(64); if (world.HasComponent(entity)) buf = world.GetComponent(entity) -> Name.ToString(); - else + else buf = std::to_string(static_cast(entity)); const bool selected = (m_selected_entity == entity); @@ -538,7 +538,13 @@ void ui_layer::render_entity_hierarchy(ECWorld& world) return; } - ImGui::Text("Selected entity: %u", static_cast(m_selected_entity)); + std::string buf; + buf.reserve(64); + if (world.HasComponent(m_selected_entity)) + buf = "Selected entity: " + world.GetComponent(m_selected_entity) -> Name.ToString(); + else + buf = "Selected entity: " + std::to_string(static_cast(m_selected_entity)); + ImGui::Text(buf.c_str()); ImGui::Separator(); // Identification