godot-psd-training/trainings/confirmDialog/confirmDialog.gd

34 lines
587 B
GDScript3
Raw Normal View History

2024-05-16 16:30:14 +08:00
extends Window
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
signal two_confirm()
signal two_cancel()
func show_confirm(text):
$PanelContainer/VBoxContainer/Label.text = text
self.show()
func _on_cancel_button_down():
emit_signal("two_cancel")
self.hide()
func _on_confirm_button_down():
emit_signal("two_confirm")
self.hide()
func _on_close_requested():
emit_signal("two_cancel")
self.hide()