mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 10:29:19 +02:00
Change in entity hierarchy naming
This commit is contained in:
@@ -496,12 +496,16 @@ void ui_layer::render_entity_hierarchy(ECWorld& world)
|
|||||||
|
|
||||||
for (auto entity : world.GetEntities())
|
for (auto entity : world.GetEntities())
|
||||||
{
|
{
|
||||||
char buf[64];
|
std::string buf;
|
||||||
std::snprintf(buf, sizeof(buf), "Entity %u", static_cast<unsigned>(entity));
|
buf.reserve(64);
|
||||||
|
if (world.HasComponent<ECSComponent::Identification>(entity))
|
||||||
|
buf = world.GetComponent<ECSComponent::Identification>(entity) -> Name.ToString();
|
||||||
|
else
|
||||||
|
buf = std::to_string(static_cast<unsigned>(entity));
|
||||||
|
|
||||||
const bool selected = (m_selected_entity == entity);
|
const bool selected = (m_selected_entity == entity);
|
||||||
|
|
||||||
if (ImGui::Selectable(buf, selected))
|
if (ImGui::Selectable(buf.c_str(), selected))
|
||||||
{
|
{
|
||||||
m_selected_entity = entity;
|
m_selected_entity = entity;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user