mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 17:29:18 +02:00
Add name info into selected label
This commit is contained in:
@@ -538,7 +538,13 @@ void ui_layer::render_entity_hierarchy(ECWorld& world)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Text("Selected entity: %u", static_cast<unsigned>(m_selected_entity));
|
std::string buf;
|
||||||
|
buf.reserve(64);
|
||||||
|
if (world.HasComponent<ECSComponent::Identification>(m_selected_entity))
|
||||||
|
buf = "Selected entity: " + world.GetComponent<ECSComponent::Identification>(m_selected_entity) -> Name.ToString();
|
||||||
|
else
|
||||||
|
buf = "Selected entity: " + std::to_string(static_cast<unsigned>(m_selected_entity));
|
||||||
|
ImGui::Text(buf.c_str());
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
// Identification
|
// Identification
|
||||||
|
|||||||
Reference in New Issue
Block a user