mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Fix Error when connecting signal with unbinds not yet existing function
When a Signal with unbinds was connected to a non-existing function, the connection attempt was made before the function was created. I moved the creation of the function in front of the connection attempt.
This commit is contained in:
@@ -1001,13 +1001,6 @@ void ConnectionsDock::_make_or_edit_connection() {
|
||||
}
|
||||
}
|
||||
|
||||
if (connect_dialog->is_editing()) {
|
||||
_disconnect(connect_dialog->get_source_connection_data());
|
||||
_connect(cd);
|
||||
} else {
|
||||
_connect(cd);
|
||||
}
|
||||
|
||||
if (add_script_function_request) {
|
||||
PackedStringArray script_function_args = connect_dialog->get_signal_args();
|
||||
script_function_args.resize(script_function_args.size() - cd.unbinds);
|
||||
@@ -1057,6 +1050,13 @@ void ConnectionsDock::_make_or_edit_connection() {
|
||||
EditorNode::get_singleton()->emit_signal(SNAME("script_add_function_request"), target, cd.method, script_function_args);
|
||||
}
|
||||
|
||||
if (connect_dialog->is_editing()) {
|
||||
_disconnect(connect_dialog->get_source_connection_data());
|
||||
_connect(cd);
|
||||
} else {
|
||||
_connect(cd);
|
||||
}
|
||||
|
||||
update_tree();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user