Component fields in the editor are now sorted in the order they're defined

This commit is contained in:
2016-01-27 17:12:07 +01:00
parent 4b7613a659
commit c519ba2536
+2 -3
View File
@@ -285,9 +285,8 @@ bool EditorGUI::drawComponentNode(EntityWrapper entity, const ComponentInfo& ci)
// Draw component fields
ComponentWrapper& component = entity.World->GetComponent(entity.ID, ci.Name);
for (auto& kv : ci.Fields) {
const std::string& fieldName = kv.first;
const ComponentInfo::Field_t& field = kv.second;
for (auto& fieldName : ci.FieldsInOrder) {
const ComponentInfo::Field_t& field = ci.Fields.at(fieldName);
// Draw the field widget based on its type
bool dirty = drawComponentField(component, field);