class_name SongControls extends Control ## The buttons for the song that is playing: show the answer, and go to the next song. signal show_answer_pressed signal next_pressed @onready var show_answer_button: Button = $ShowAnswerButton @onready var next_button: Button = $NextButton func _ready() -> void: show_answer_button.pressed.connect(show_answer_pressed.emit) next_button.pressed.connect(next_pressed.emit) ## Enables Next while there is a downloaded song to play next. func set_next_enabled(enabled: bool) -> void: next_button.disabled = !enabled ## Disables both buttons, e.g. while the server syncs the song list. Unlocking enables ## Show answer again; Next comes back when the next song has been downloaded. func set_locked(locked: bool) -> void: show_answer_button.disabled = locked if locked: next_button.disabled = true