You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +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:
@@ -78,6 +78,15 @@ StringName GDScriptLambdaCallable::get_method() const {
|
||||
return function->get_name();
|
||||
}
|
||||
|
||||
int GDScriptLambdaCallable::get_argument_count(bool &r_is_valid) const {
|
||||
if (function == nullptr) {
|
||||
r_is_valid = false;
|
||||
return 0;
|
||||
}
|
||||
r_is_valid = true;
|
||||
return function->get_argument_count();
|
||||
}
|
||||
|
||||
void GDScriptLambdaCallable::call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const {
|
||||
int captures_amount = captures.size();
|
||||
|
||||
@@ -189,6 +198,15 @@ ObjectID GDScriptLambdaSelfCallable::get_object() const {
|
||||
return object->get_instance_id();
|
||||
}
|
||||
|
||||
int GDScriptLambdaSelfCallable::get_argument_count(bool &r_is_valid) const {
|
||||
if (function == nullptr) {
|
||||
r_is_valid = false;
|
||||
return 0;
|
||||
}
|
||||
r_is_valid = true;
|
||||
return function->get_argument_count();
|
||||
}
|
||||
|
||||
void GDScriptLambdaSelfCallable::call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const {
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (object->get_script_instance() == nullptr || object->get_script_instance()->get_language() != GDScriptLanguage::get_singleton()) {
|
||||
|
||||
Reference in New Issue
Block a user