stick-the-quick/ui/Conversation/ConversationChoice.gd

25 lines
632 B
GDScript3
Raw Normal View History

class_name ConversationChoice extends Control
@onready var _button := $'HBoxContainer/Button' as Button
@onready var _choice_arrow := $'HBoxContainer/ArrowMargin/ChoiceArrow'
var text: String
signal selected(what: String)
signal chosen(what: String)
func _ready() -> void:
_button.text = text
_button.pressed.connect(_on_pressed)
_button.focus_entered.connect(_on_focus_entered)
_button.focus_exited.connect(_on_focus_exited)
func _on_pressed() -> void:
chosen.emit(text)
func _on_focus_entered() -> void:
selected.emit(text)
_choice_arrow.visible = true
func _on_focus_exited() -> void:
_choice_arrow.visible = false