mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Sorting entity list by name to keep consistent order in hierarchy view
This commit is contained in:
@@ -302,6 +302,12 @@ namespace Nuake
|
||||
allEntities.push_back(newEntity);
|
||||
}
|
||||
}
|
||||
|
||||
// Temporary fix to prevent order of tree to change randomly until actual order is implemented.
|
||||
std::sort(allEntities.begin(), allEntities.end(), [](Entity a, Entity b) {
|
||||
return a.GetComponent<NameComponent>().Name < b.GetComponent<NameComponent>().Name;
|
||||
});
|
||||
|
||||
return allEntities;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user