mirror of
https://github.com/godotengine/godot.git
synced 2025-10-22 09:23:40 +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
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue