You've already forked godot
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user