Component fields in the editor are now sorted in the order they're defined
This commit is contained in:
@@ -285,9 +285,8 @@ bool EditorGUI::drawComponentNode(EntityWrapper entity, const ComponentInfo& ci)
|
|||||||
|
|
||||||
// Draw component fields
|
// Draw component fields
|
||||||
ComponentWrapper& component = entity.World->GetComponent(entity.ID, ci.Name);
|
ComponentWrapper& component = entity.World->GetComponent(entity.ID, ci.Name);
|
||||||
for (auto& kv : ci.Fields) {
|
for (auto& fieldName : ci.FieldsInOrder) {
|
||||||
const std::string& fieldName = kv.first;
|
const ComponentInfo::Field_t& field = ci.Fields.at(fieldName);
|
||||||
const ComponentInfo::Field_t& field = kv.second;
|
|
||||||
|
|
||||||
// Draw the field widget based on its type
|
// Draw the field widget based on its type
|
||||||
bool dirty = drawComponentField(component, field);
|
bool dirty = drawComponentField(component, field);
|
||||||
|
|||||||
Reference in New Issue
Block a user