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:
Sansan committed 2026-10-06 11:11:18 +02:00
1 parent bad4b3ad8b
commit e94c75e84d
32 files changed
+822 -300

No files matched your search

+15 -6
View File
@@ -1,14 +1,16 @@
class_name MusicPlayer
extends PanelContainer
extends Control
## The bar that plays the songs, with play, restart, progress and volume, and the
## auto repeat switch under it.
# LOC 20/1-24: 136
# LOC 12/6-24: 170
@onready
var play_button: TextureButton = $MusicPlayerContainer/PlayTextureButton
var play_button: TextureButton = $PlayerBar/MusicPlayerContainer/PlayTextureButton
@onready
var restart_button: TextureButton = $MusicPlayerContainer/RestartTextureButton
var restart_button: TextureButton = $PlayerBar/MusicPlayerContainer/RestartTextureButton
@onready
var audio_player: AudioStreamPlayer = $AudioStreamPlayer
@@ -20,13 +22,16 @@ var sound_player: AudioStreamPlayer = $AudioSoundPlayer
var sound_effect_player: AudioStreamPlayer = $AudioSoundEffectPlayer
@onready
var progress_slider: HSlider = $MusicPlayerContainer/MusicPlayerSlider
var progress_slider: HSlider = $PlayerBar/MusicPlayerContainer/MusicPlayerSlider
@onready
var volume_slider: HSlider = $MusicPlayerContainer/VolumeSlider
var volume_slider: HSlider = $PlayerBar/MusicPlayerContainer/VolumeSlider
@onready
var music_time_label: Label = $MusicPlayerContainer/MusicTimeLabel
var music_time_label: Label = $PlayerBar/MusicPlayerContainer/MusicTimeLabel
@onready
var auto_repeat_button: CheckButton = $RepeatSongCheckButton
var play_icon: Texture = preload("res://icons/play_icon_light.svg")
var pause_icon: Texture = preload("res://icons/pause_icon_light.svg")
@@ -49,6 +54,10 @@ func _ready() -> void:
progress_slider.drag_ended.connect(_on_drag_ended)
audio_player.finished.connect(_on_finished)
auto_repeat_button.pressed.connect(_on_auto_repeat_pressed)
func _on_auto_repeat_pressed() -> void:
Settings.auto_repeat_song = !Settings.auto_repeat_song
func _process(_delta: float) -> void:
if audio_player.has_stream_playback() && !is_changing && !audio_player.stream_paused: