mirror of
https://github.com/godotengine/godot.git
synced 2025-10-21 17:03:42 +00:00
Reworked signal connection system, added support for Callable and Signal objects and made them default.
This commit is contained in:
parent
1a4be2cd8f
commit
69c95f4b4c
275 changed files with 3831 additions and 2948 deletions
|
@ -1229,7 +1229,7 @@ public:
|
|||
|
||||
//virtual int get_working_memory_size() const { return 0; }
|
||||
//execute by parsing the tree directly
|
||||
virtual bool _execute(const Variant **p_inputs, VisualScriptExpression::ENode *p_node, Variant &r_ret, String &r_error_str, Variant::CallError &ce) {
|
||||
virtual bool _execute(const Variant **p_inputs, VisualScriptExpression::ENode *p_node, Variant &r_ret, String &r_error_str, Callable::CallError &ce) {
|
||||
|
||||
switch (p_node->type) {
|
||||
case VisualScriptExpression::ENode::TYPE_INPUT: {
|
||||
|
@ -1371,7 +1371,7 @@ public:
|
|||
|
||||
r_ret = Variant::construct(constructor->data_type, (const Variant **)argp.ptr(), argp.size(), ce);
|
||||
|
||||
if (ce.error != Variant::CallError::CALL_OK) {
|
||||
if (ce.error != Callable::CallError::CALL_OK) {
|
||||
r_error_str = "Invalid arguments to construct '" + Variant::get_type_name(constructor->data_type) + "'.";
|
||||
return true;
|
||||
}
|
||||
|
@ -1398,7 +1398,7 @@ public:
|
|||
|
||||
VisualScriptBuiltinFunc::exec_func(bifunc->func, (const Variant **)argp.ptr(), &r_ret, ce, r_error_str);
|
||||
|
||||
if (ce.error != Variant::CallError::CALL_OK) {
|
||||
if (ce.error != Callable::CallError::CALL_OK) {
|
||||
r_error_str = "Builtin Call Failed. " + r_error_str;
|
||||
return true;
|
||||
}
|
||||
|
@ -1430,7 +1430,7 @@ public:
|
|||
|
||||
r_ret = base.call(call->method, (const Variant **)argp.ptr(), argp.size(), ce);
|
||||
|
||||
if (ce.error != Variant::CallError::CALL_OK) {
|
||||
if (ce.error != Callable::CallError::CALL_OK) {
|
||||
r_error_str = "On call to '" + String(call->method) + "':";
|
||||
return true;
|
||||
}
|
||||
|
@ -1440,24 +1440,24 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Variant::CallError &r_error, String &r_error_str) {
|
||||
virtual int step(const Variant **p_inputs, Variant **p_outputs, StartMode p_start_mode, Variant *p_working_mem, Callable::CallError &r_error, String &r_error_str) {
|
||||
|
||||
if (!expression->root || expression->error_set) {
|
||||
r_error_str = expression->error_str;
|
||||
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool error = _execute(p_inputs, expression->root, *p_outputs[0], r_error_str, r_error);
|
||||
if (error && r_error.error == Variant::CallError::CALL_OK) {
|
||||
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
|
||||
if (error && r_error.error == Callable::CallError::CALL_OK) {
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
if (!error && expression->output_type != Variant::NIL && !Variant::can_convert_strict(p_outputs[0]->get_type(), expression->output_type)) {
|
||||
|
||||
r_error_str += "Can't convert expression result from " + Variant::get_type_name(p_outputs[0]->get_type()) + " to " + Variant::get_type_name(expression->output_type) + ".";
|
||||
r_error.error = Variant::CallError::CALL_ERROR_INVALID_METHOD;
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue