2024-02-22 06:22:22 +11:00
|
|
|
class_name TextInputPopup extends PanelContainer
|
2023-11-08 14:28:55 +11:00
|
|
|
|
2024-02-22 06:22:22 +11:00
|
|
|
signal completed(outcome: bool)
|
2023-11-08 14:28:55 +11:00
|
|
|
|
2024-02-22 06:22:22 +11:00
|
|
|
|
|
|
|
func set_popup(prompt_text: String, placeholder_text: String, confirm_text: String) -> void:
|
2023-11-08 14:28:55 +11:00
|
|
|
$VBoxContainer/LineEdit.text = prompt_text
|
|
|
|
$VBoxContainer/LineEdit.placeholder_text = placeholder_text
|
|
|
|
$VBoxContainer/Button.text = confirm_text
|
|
|
|
|
|
|
|
|
|
|
|
func _on_button_pressed() -> void:
|
|
|
|
completed.emit($VBoxContainer/LineEdit.text)
|
|
|
|
queue_free()
|
2023-12-17 02:02:16 +11:00
|
|
|
|
|
|
|
|
|
|
|
func _on_button_mouse_entered() -> void:
|
|
|
|
$AudioStreamPlayer.play()
|