1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-29 16:16:38 +00:00

Properly report Callable bound arguments

Fixes #63213
Adds a function: Callable::get_amount_of_arguments_bound() to query this in callables. Exposed to the engine API.
This commit is contained in:
Juan Linietsky
2023-01-06 15:37:53 +01:00
parent b14f7aa9f9
commit 0e0ca01bce
7 changed files with 32 additions and 2 deletions

View File

@@ -137,6 +137,14 @@ StringName Callable::get_method() const {
return method;
}
int Callable::get_bound_arguments_count() const {
if (!is_null() && is_custom()) {
return custom->get_bound_arguments_count();
} else {
return 0;
}
}
CallableCustom *Callable::get_custom() const {
ERR_FAIL_COND_V_MSG(!is_custom(), nullptr,
vformat("Can't get custom on non-CallableCustom \"%s\".", operator String()));
@@ -344,6 +352,10 @@ const Callable *CallableCustom::get_base_comparator() const {
return nullptr;
}
int CallableCustom::get_bound_arguments_count() const {
return 0;
}
CallableCustom::CallableCustom() {
ref_count.init();
}