mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Add methods to get argument count of methods
Added to: * `Callable`s * `Object`s * `ClassDB` * `Script(Instance)`s
This commit is contained in:
parent
0ace0a1292
commit
59bcc2888c
50 changed files with 821 additions and 3 deletions
|
@ -102,6 +102,22 @@ Dictionary Script::_get_script_constant_map() {
|
|||
return ret;
|
||||
}
|
||||
|
||||
int Script::get_script_method_argument_count(const StringName &p_method, bool *r_is_valid) const {
|
||||
MethodInfo mi = get_method_info(p_method);
|
||||
|
||||
if (mi == MethodInfo()) {
|
||||
if (r_is_valid) {
|
||||
*r_is_valid = false;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (r_is_valid) {
|
||||
*r_is_valid = true;
|
||||
}
|
||||
return mi.arguments.size();
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
PropertyInfo Script::get_class_category() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue