ConnectionDialog: Don't allow connecting to a Node without a script if target method is invalid.
Shows a warning now. Fixes #6656
This commit is contained in:
parent
ac80e68d2f
commit
5b7021434f
1 changed files with 8 additions and 0 deletions
|
@ -181,6 +181,14 @@ void ConnectDialog::ok_pressed() {
|
||||||
error->popup_centered_minsize();
|
error->popup_centered_minsize();
|
||||||
return;
|
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");
|
emit_signal("connected");
|
||||||
hide();
|
hide();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue