mirror of
https://github.com/godotengine/godot.git
synced 2025-02-11 21:30:56 +00:00
Merge pull request #6701 from Hinsbart/connect_noscript
ConnectionDialog: Don't allow connecting to a Node without a script if target method is invalid.
This commit is contained in:
commit
a3bac99c1c
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user