Expose `ClassDB::is_enum_bitfield` as `ClassDB::is_class_enum_bitfield`

This commit is contained in:
Chris Cranford 2024-04-07 19:21:19 -04:00
parent f47f4a02c8
commit c936ee54ee
3 changed files with 18 additions and 1 deletions

View File

@ -1528,6 +1528,10 @@ StringName ClassDB::class_get_integer_constant_enum(const StringName &p_class, c
return ::ClassDB::get_integer_constant_enum(p_class, p_name, p_no_inheritance);
}
bool ClassDB::is_class_enum_bitfield(const StringName &p_class, const StringName &p_enum, bool p_no_inheritance) const {
return ::ClassDB::is_enum_bitfield(p_class, p_enum, p_no_inheritance);
}
bool ClassDB::is_class_enabled(const StringName &p_class) const {
return ::ClassDB::is_class_enabled(p_class);
}
@ -1544,7 +1548,7 @@ void ClassDB::get_argument_options(const StringName &p_function, int p_idx, List
pf == "class_has_method" || pf == "class_get_method_list" ||
pf == "class_get_integer_constant_list" || pf == "class_has_integer_constant" || pf == "class_get_integer_constant" ||
pf == "class_has_enum" || pf == "class_get_enum_list" || pf == "class_get_enum_constants" || pf == "class_get_integer_constant_enum" ||
pf == "is_class_enabled");
pf == "is_class_enabled" || pf == "is_class_enum_bitfield");
}
if (first_argument_is_class || pf == "is_parent_class") {
for (const String &E : get_class_list()) {
@ -1589,6 +1593,8 @@ void ClassDB::_bind_methods() {
::ClassDB::bind_method(D_METHOD("class_get_enum_constants", "class", "enum", "no_inheritance"), &ClassDB::class_get_enum_constants, DEFVAL(false));
::ClassDB::bind_method(D_METHOD("class_get_integer_constant_enum", "class", "name", "no_inheritance"), &ClassDB::class_get_integer_constant_enum, DEFVAL(false));
::ClassDB::bind_method(D_METHOD("is_class_enum_bitfield", "class", "enum", "no_inheritance"), &ClassDB::is_class_enum_bitfield, DEFVAL(false));
::ClassDB::bind_method(D_METHOD("is_class_enabled", "class"), &ClassDB::is_class_enabled);
}

View File

@ -461,6 +461,8 @@ public:
PackedStringArray class_get_enum_constants(const StringName &p_class, const StringName &p_enum, bool p_no_inheritance = false) const;
StringName class_get_integer_constant_enum(const StringName &p_class, const StringName &p_name, bool p_no_inheritance = false) const;
bool is_class_enum_bitfield(const StringName &p_class, const StringName &p_enum, bool p_no_inheritance = false) const;
bool is_class_enabled(const StringName &p_class) const;
#ifdef TOOLS_ENABLED

View File

@ -192,6 +192,15 @@
Returns whether this [param class] is enabled or not.
</description>
</method>
<method name="is_class_enum_bitfield" qualifiers="const">
<return type="bool" />
<param index="0" name="class" type="StringName" />
<param index="1" name="enum" type="StringName" />
<param index="2" name="no_inheritance" type="bool" default="false" />
<description>
Returns whether [param class] (or its ancestor classes if [param no_inheritance] is [code]false[/code]) has an enum called [param enum] that is a bitfield.
</description>
</method>
<method name="is_parent_class" qualifiers="const">
<return type="bool" />
<param index="0" name="class" type="StringName" />