You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-21 14:57:09 +00:00
Export attribute fixes and improvements
- Allow non-public fields to be exported as well (to avoid confusion). - Set PROPERTY_HINT_RESOURCE_TYPE for resource derived fields. - Support enums and automatically fill PROPERTY_HINT_ENUM's hint_string for enum fields.
This commit is contained in:
@@ -51,6 +51,7 @@ void GDMonoField::set_value(MonoObject *p_object, const Variant &p_value) {
|
||||
{ \
|
||||
m_type val = p_value.operator m_type(); \
|
||||
mono_field_set_value(p_object, mono_field, &val); \
|
||||
break; \
|
||||
}
|
||||
|
||||
#define SET_FROM_ARRAY_AND_BREAK(m_type) \
|
||||
@@ -137,6 +138,9 @@ void GDMonoField::set_value(MonoObject *p_object, const Variant &p_value) {
|
||||
if (tclass == CACHED_CLASS(Plane))
|
||||
SET_FROM_STRUCT_AND_BREAK(Plane);
|
||||
|
||||
if (mono_class_is_enum(tclass->get_raw()))
|
||||
SET_FROM_PRIMITIVE(signed int);
|
||||
|
||||
ERR_EXPLAIN(String() + "Attempted to set the value of a field of unmarshallable type: " + tclass->get_name());
|
||||
ERR_FAIL();
|
||||
} break;
|
||||
|
||||
Reference in New Issue
Block a user