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.
This commit is contained in:
1 parent
bad4b3ad8b
commit
e94c75e84d
32 files changed
+822
-300
No files matched your search
@@ -0,0 +1,27 @@
|
||||
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
|
||||
Reference in new issue
Block a user