From cc7351cd10a1458438e471f0885ec18dc9bf87ee Mon Sep 17 00:00:00 2001 From: MinusKube Date: Sun, 22 Jan 2023 21:54:21 +0100 Subject: [PATCH 1/2] Remove coupling between ConnectDialog and selected signal --- editor/connections_dialog.cpp | 106 ++++++++++++++++------------------ editor/connections_dialog.h | 14 +++-- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index 6f4736dca70..8857b0c50e9 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -303,10 +303,18 @@ Node *ConnectDialog::get_source() const { return source; } +ConnectDialog::ConnectionData ConnectDialog::get_source_connection_data() const { + return source_connection_data; +} + StringName ConnectDialog::get_signal_name() const { return signal; } +PackedStringArray ConnectDialog::get_signal_args() const { + return signal_args; +} + NodePath ConnectDialog::get_dst_path() const { return dst_path; } @@ -355,11 +363,12 @@ bool ConnectDialog::is_editing() const { * If creating a connection from scratch, sensible defaults are used. * If editing an existing connection, previous data is retained. */ -void ConnectDialog::init(ConnectionData p_cd, bool p_edit) { +void ConnectDialog::init(const ConnectionData &p_cd, const PackedStringArray &p_signal_args, bool p_edit) { set_hide_on_ok(false); source = static_cast(p_cd.source); signal = p_cd.signal; + signal_args = p_signal_args; tree->set_selected(nullptr); tree->set_marked(source, true); @@ -377,22 +386,7 @@ void ConnectDialog::init(ConnectionData p_cd, bool p_edit) { deferred->set_pressed(b_deferred); one_shot->set_pressed(b_oneshot); - MethodInfo r_signal; - Ref