summaryrefslogtreecommitdiff
path: root/tools/editor/connections_dialog.cpp
diff options
context:
space:
mode:
authorAndreas Haas <liu.gam3@gmail.com>2016-10-04 13:27:08 +0200
committerAndreas Haas <liu.gam3@gmail.com>2016-10-04 16:05:25 +0200
commit5b7021434f27145550ddb5de74dc66e9273d4dcb (patch)
tree66de5674fe14137d6f48a73bdfb0b0307acb62ca /tools/editor/connections_dialog.cpp
parentac80e68d2f60012f315d268c4a9d70dffb02f901 (diff)
ConnectionDialog: Don't allow connecting to a Node without a script if target method is invalid.
Shows a warning now. Fixes #6656
Diffstat (limited to 'tools/editor/connections_dialog.cpp')
-rw-r--r--tools/editor/connections_dialog.cpp8
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();