1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #87680 from AThousandShips/the_angry_count

Add methods to get argument count of methods
This commit is contained in:
Rémi Verschelde
2024-03-13 22:16:43 +01:00
50 changed files with 821 additions and 3 deletions

View File

@@ -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 {