You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Support explicit values in flag properties, add C# flags support
- Add support for explicit values in properties using `PROPERTY_HINT_FLAGS` that works the same way it does for enums. - Fix enums and flags in VisualScriptEditor (it wasn't considering the explicit value). - Use `PROPERTY_HINT_FLAGS` for C# enums with the FlagsAttribute instead of `PROPERTY_HINT_ENUM`.
This commit is contained in:
@@ -587,6 +587,14 @@ bool type_is_generic_idictionary(MonoReflectionType *p_reftype) {
|
||||
return (bool)res;
|
||||
}
|
||||
|
||||
bool type_has_flags_attribute(MonoReflectionType *p_reftype) {
|
||||
NO_GLUE_RET(false);
|
||||
MonoException *exc = nullptr;
|
||||
MonoBoolean res = CACHED_METHOD_THUNK(MarshalUtils, TypeHasFlagsAttribute).invoke(p_reftype, &exc);
|
||||
UNHANDLED_EXCEPTION(exc);
|
||||
return (bool)res;
|
||||
}
|
||||
|
||||
void get_generic_type_definition(MonoReflectionType *p_reftype, MonoReflectionType **r_generic_reftype) {
|
||||
MonoException *exc = nullptr;
|
||||
CACHED_METHOD_THUNK(MarshalUtils, GetGenericTypeDefinition).invoke(p_reftype, r_generic_reftype, &exc);
|
||||
|
||||
Reference in New Issue
Block a user