2023-11-08 14:28:55 +11:00
|
|
|
extends PanelContainer
|
|
|
|
class_name ConfirmationPopup
|
|
|
|
|
|
|
|
signal completed(outcome)
|
|
|
|
|
|
|
|
func set_popup(prompt_text, confirm_text, cancel_text):
|
|
|
|
$VBoxContainer/Label.text = prompt_text
|
2023-11-19 18:47:52 +11:00
|
|
|
$VBoxContainer/HBoxContainer/MarginContainer/Confirm.text = confirm_text
|
|
|
|
$VBoxContainer/HBoxContainer/MarginContainer2/Cancel.text = cancel_text
|
2023-11-08 14:28:55 +11:00
|
|
|
|
|
|
|
|
|
|
|
func _on_confirm_pressed() -> void:
|
|
|
|
completed.emit(true)
|
|
|
|
queue_free()
|
|
|
|
|
|
|
|
|
|
|
|
func _on_cancel_pressed() -> void:
|
|
|
|
completed.emit(false)
|
|
|
|
queue_free()
|