mtd/Scripts/text_input_popup.gd

19 lines
492 B
GDScript3
Raw Normal View History

2024-02-22 06:22:22 +11:00
class_name TextInputPopup extends PanelContainer
2024-02-22 06:22:22 +11:00
signal completed(outcome: bool)
2024-02-22 06:22:22 +11:00
func set_popup(prompt_text: String, placeholder_text: String, confirm_text: String) -> void:
$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()
func _on_button_mouse_entered() -> void:
$AudioStreamPlayer.play()