summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorMicky <micheledevita2@gmail.com>2022-12-06 13:50:54 +0100
committerMicky <micheledevita2@gmail.com>2022-12-08 13:36:48 +0100
commit885f2a4eca0f348e8d04e45e6e9a0e950f4c6964 (patch)
tree554b93f867a413d82c3e020c475d0c095824cb42 /editor
parentf3e6750a7e4702918e05f42b1376e30e652f2f90 (diff)
Fix unable to disconnect signal in Editor once created
Adds a CONNECT_INHERITED flag to connections, only available in editor builds. This flag denotes that the signal has been inherited from a previous Scene in the instancing hierarchy.
Diffstat (limited to 'editor')
-rw-r--r--editor/connections_dialog.cpp18
1 files changed, 1 insertions, 17 deletions
diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp
index 2bd77bf99c..1f0cc1dc77 100644
--- a/editor/connections_dialog.cpp
+++ b/editor/connections_dialog.cpp
@@ -788,23 +788,7 @@ bool ConnectionsDock::_is_item_signal(TreeItem &p_item) {
}
bool ConnectionsDock::_is_connection_inherited(Connection &p_connection) {
- Node *scene_root = EditorNode::get_singleton()->get_edited_scene();
- Ref<PackedScene> scn = ResourceLoader::load(scene_root->get_scene_file_path());
- ERR_FAIL_NULL_V(scn, false);
-
- Ref<SceneState> state = scn->get_state();
- ERR_FAIL_NULL_V(state, false);
-
- Node *source = Object::cast_to<Node>(p_connection.signal.get_object());
- Node *target = Object::cast_to<Node>(p_connection.callable.get_object());
-
- const NodePath source_path = scene_root->get_path_to(source);
- const NodePath target_path = scene_root->get_path_to(target);
- const StringName signal_name = p_connection.signal.get_name();
- const StringName method_name = p_connection.callable.get_method();
-
- // If it cannot be found in PackedScene, this connection was inherited.
- return !state->has_connection(source_path, signal_name, target_path, method_name, true);
+ return bool(p_connection.flags & CONNECT_INHERITED);
}
/*