Check whether the signals are already connected in uveditor's popup. This fixed an in-editor error message.

This commit is contained in:
Relintai 2022-01-23 01:26:25 +01:00
parent 8523380059
commit 5c9841c480

View File

@ -2,8 +2,11 @@ tool
extends ConfirmationDialog
func _enter_tree():
connect("confirmed", self, "on_ok_pressed")
get_cancel().connect("pressed", self, "on_cancel_pressed")
if !is_connected("confirmed", self, "on_ok_pressed"):
connect("confirmed", self, "on_ok_pressed")
if !get_cancel().is_connected("pressed", self, "on_cancel_pressed"):
get_cancel().connect("pressed", self, "on_cancel_pressed")
func on_ok_pressed() -> void:
$UVEditor.ok_pressed()