Files
MusicPlayer/song_controls.gd
T
Sansan e94c75e84d Split now playing, the quiz buttons and song loading out of the quiz
NowPlaying, QuizToolbar and SongControls become their own scenes, the auto
repeat switch moves into the music player scene, and downloading songs moves
into a SongLoader node. The quiz only wires the parts together. Every node
keeps its place on screen.

Screenshots of every UI state are pixel-identical to before, the layout test
still matches the original baseline, and each new part has its own tests.
2026-10-06 11:11:18 +02:00

28 lines
848 B
GDScript

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