-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
Add static method support to core Variant types #46378
Add static method support to core Variant types #46378
Conversation
reduz
commented
Feb 24, 2021
•
edited by vnen
Loading
edited by vnen
- Properly exposed, including validated and variant call
- Bound static functions in String and Color
- Did not add support for scripting languages or GDNative, will have to be added manually by @vnen
@@ -394,13 +394,22 @@ void DocTools::generate(bool p_basic_types) { | |||
method.qualifiers += " "; | |||
} | |||
method.qualifiers += "const"; | |||
} else if (E->get().flags & METHOD_FLAG_VARARG) { | |||
} |
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.
This seemed wrong somehow, not quite sure why it was like this, so I changed it.
Does it support non-variant classes like e.g. File? |
@KoBeWi not for now, maybe in a future one. One thing at a time. |
This error is shown when starting the project manager or editing any project:
Otherwise seems fine. A description will need to be added for the new Lines 1050 to 1056 in 369dffc
(As a side note, it could be nice to have those abbr tooltips in the in-editor docs too @Calinou.) |
Tooltips in the editor help require godotengine/godot-proposals#1285 to be implemented first. |
This is because of |
core/variant/variant.h
Outdated
static bool is_builtin_method_vararg(Variant::Type p_type, const StringName &p_method); | ||
static void get_builtin_method_list(Variant::Type p_type, List<StringName> *p_list); | ||
static int get_builtin_method_count(Variant::Type p_type); | ||
|
||
void call(const StringName &p_method, const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error); | ||
Variant call(const StringName &p_method, const Variant &p_arg1 = Variant(), const Variant &p_arg2 = Variant(), const Variant &p_arg3 = Variant(), const Variant &p_arg4 = Variant(), const Variant &p_arg5 = Variant()); | ||
|
||
void call_static(Variant::Type p_type, const StringName &p_method, const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error); |
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.
Shouldn't this be static?
Also (not sure if you want to change this here) |
2172798
to
d734667
Compare
I updated this to make the For the |
* Properly exposed, including validated and variant call * Bound static functions in String and Color * Did not add support for scripting languages, will have to be added manually.
d734667
to
ecfa570
Compare
Thanks! |