Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose ClassDB::is_enum_bitfield as ClassDB::is_class_enum_bitfield #90368

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion core/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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()) {
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 2 additions & 0 deletions core/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ class ClassDB : public Object {
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
Expand Down
9 changes: 9 additions & 0 deletions doc/classes/ClassDB.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />
Expand Down
Loading