Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked signal system, added support for Callable and Signal #36368

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ struct _ArrayVariantSortCustom {
_FORCE_INLINE_ bool operator()(const Variant &p_l, const Variant &p_r) const {

const Variant *args[2] = { &p_l, &p_r };
Variant::CallError err;
Callable::CallError err;
bool res = obj->call(func, args, 2, err);
if (err.error != Variant::CallError::CALL_OK)
if (err.error != Callable::CallError::CALL_OK)
res = false;
return res;
}
Expand Down
12 changes: 6 additions & 6 deletions core/bind/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2620,29 +2620,29 @@ void _Thread::_start_func(void *ud) {
Ref<_Thread> *tud = (Ref<_Thread> *)ud;
Ref<_Thread> t = *tud;
memdelete(tud);
Variant::CallError ce;
Callable::CallError ce;
const Variant *arg[1] = { &t->userdata };

Thread::set_name(t->target_method);

t->ret = t->target_instance->call(t->target_method, arg, 1, ce);
if (ce.error != Variant::CallError::CALL_OK) {
if (ce.error != Callable::CallError::CALL_OK) {

String reason;
switch (ce.error) {
case Variant::CallError::CALL_ERROR_INVALID_ARGUMENT: {
case Callable::CallError::CALL_ERROR_INVALID_ARGUMENT: {

reason = "Invalid Argument #" + itos(ce.argument);
} break;
case Variant::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: {
case Callable::CallError::CALL_ERROR_TOO_MANY_ARGUMENTS: {

reason = "Too Many Arguments";
} break;
case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: {
case Callable::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: {

reason = "Too Few Arguments";
} break;
case Variant::CallError::CALL_ERROR_INVALID_METHOD: {
case Callable::CallError::CALL_ERROR_INVALID_METHOD: {

reason = "Method Not Found";
} break;
Expand Down
Loading