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