mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-19 00:59:18 +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())
|
||||
{
|
||||
char buf[64];
|
||||
std::snprintf(buf, sizeof(buf), "Entity %u", static_cast<unsigned>(entity));
|
||||
std::string buf;
|
||||
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);
|
||||
|
||||
if (ImGui::Selectable(buf, selected))
|
||||
if (ImGui::Selectable(buf.c_str(), selected))
|
||||
{
|
||||
m_selected_entity = entity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user