ScriptCore: Add Entry for dictionaries

This commit is contained in:
Simon Lübeß
2024-01-06 13:12:50 +01:00
parent 13baf2f4bc
commit 5d9973a791
2 changed files with 52 additions and 3 deletions
+5 -1
View File
@@ -111,7 +111,7 @@ internal class EntityEditor
return (T?)attributes?.FirstOrDefault(a => a is T);
}
private static object ShowPrimitiveEditor(object reference, Type fieldType, string fieldName, IEnumerable<Attribute>? attributes)
private static object? ShowPrimitiveEditor(object? reference, Type fieldType, string fieldName, IEnumerable<Attribute>? attributes)
{
object newValue = DidNotChange;
@@ -230,6 +230,10 @@ internal class EntityEditor
ImGui.TextColored(new Vector4(1, 0, 0, 1), $"{fieldName}: Type {fieldType} is not implemented.");
}
}
else
{
return ActivatorExtension.CreateInstanceSafe(fieldType);
}
return newValue;
}