-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Allow to get list of non object methods #49053
Conversation
Yeah... |
core/core_bind.cpp
Outdated
@@ -2188,7 +2188,27 @@ bool _ClassDB::is_class_enabled(StringName p_class) const { | |||
return ClassDB::is_class_enabled(p_class); | |||
} | |||
|
|||
Array _ClassDB::get_non_object_methods_list(Variant::Type p_type) const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've had issues with using Variant::Type
in a method signatures while generating C# mono glue and while generating/validating RST documentation (see commit in VariantResource
class in Goost). Not sure if that's still an issue in master
, though.
If that's still an issue, the workaround is to use int
over Variant::Type
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this cannot cause any issues because C# does not deal with Variant
directly, and is a special case.
71319d3
to
61823ce
Compare
5dba10f
to
05f5030
Compare
c76f1b6
to
46f72fa
Compare
4b8d672
to
257484c
Compare
257484c
to
cf2816d
Compare
We discussed this in a PR meeting and @reduz suggests that this should not go in ClassDB because it's not part of its scope. This could maybe be implemented in |
I think we should create a singleton class in core_bind to expose Variant reflection to scripting, but I am not exactly sure what it should be called. Maybe TypeDB ? |
cf2816d
to
0be51ee
Compare
1/3 of godotengine/godot-proposals#2344
This allow to get list of e.g. String methods by using:
_ClassDB::get_variant_method_list
is almost 1:1 copy of_ClassDB::get_method_list
also
Variant::get_method_list_by_type
is just extracted code fromVariant::get_method_list
to be able not duplicate same code.get_non_object_methods_list
isn't the best name, so it should be renamed to something better