diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-10-09 14:15:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-09 14:15:21 +0200 |
commit | a3bac99c1c034af30ab5ea0f0650d81a7eb4c349 (patch) | |
tree | 2675504b4f51038032c02c3fd9e041c9f4ff3529 /tools/editor/connections_dialog.cpp | |
parent | a938319bb7383de920653e2f130238384de84d1c (diff) | |
parent | 5b7021434f27145550ddb5de74dc66e9273d4dcb (diff) |
Merge pull request #6701 from Hinsbart/connect_noscript
ConnectionDialog: Don't allow connecting to a Node without a script if target method is invalid.
Diffstat (limited to 'tools/editor/connections_dialog.cpp')
-rw-r--r-- | tools/editor/connections_dialog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/editor/connections_dialog.cpp b/tools/editor/connections_dialog.cpp index c4f2435675..1baad2c6b3 100644 --- a/tools/editor/connections_dialog.cpp +++ b/tools/editor/connections_dialog.cpp @@ -181,6 +181,14 @@ void ConnectDialog::ok_pressed() { error->popup_centered_minsize(); return; } + Node* target = tree->get_selected(); + if (target->get_script().is_null()) { + if (!target->has_method(dst_method->get_text())) { + error->set_text(TTR("Target method not found! Specify a valid method or attach a script to target Node.")); + error->popup_centered_minsize(); + return; + } + } emit_signal("connected"); hide(); |