Add offline mode: play from a music folder instead of the server
Build / test (push) Successful in 1m2s
Build / build (push) Successful in 1m12s

Settings has a Music folder row. A folder with subfolders is played as
soundtracks: Next picks a random subfolder and a random song in it, the
subfolder is the answer's soundtrack and the file name without its type the
song. The inspiration list and Search show the subfolders.

A folder with songs and no subfolders is a prepared quiz, played once in order
(natural sort) or at random, showing only the song title. It has no winning
score: after the last song Next becomes Show winner, and the players with the
most points win, ties included.

While a folder is used nothing but the characters is asked from the server:
Sync, QR, Statistics, the update check and play counting are off. Characters
fall back to the cached pictures when the server can't be reached. mp3, ogg and
wav play; other files and broken ones are skipped.

The old local playback code, the hidden Open button and the hidden Local toggle
are removed. Next now waits for the song to start before preparing the next one.
This commit is contained in:
Sansan committed 2026-10-07 23:07:47 +02:00
1 parent b120440404
commit 222d231b1b
42 files changed
+8245 -474

No files matched your search

+20 -16
View File
@@ -38,23 +38,27 @@ static func _generate_uuid() -> String:
hex.substr(16, 4), hex.substr(20, 12)]
## Gives the player a point. With a winning score, the point that reaches it wins; a
## prepared quiz has none, so points just add up until every song has played.
func add_point() -> void:
if player_score < Settings.winning_score:
player_score += 1
player_point_given.emit()
var first_point: bool = player_score == 1 && is_first_point
if player_score == 1:
is_first_point = false
# With a low winning score the first point can also be match point or the win,
# so the more important event is checked first
if player_score == Settings.winning_score:
winner_triggered.emit()
elif player_score == Settings.winning_score - 1:
match_point_triggered.emit()
elif first_point:
first_point_triggered.emit()
else:
point_given_sound.emit()
var has_winning_score: bool = !Settings.is_prepared_quiz()
if has_winning_score && player_score >= Settings.winning_score:
return
player_score += 1
player_point_given.emit()
var first_point: bool = player_score == 1 && is_first_point
if player_score == 1:
is_first_point = false
# With a low winning score the first point can also be match point or the win,
# so the more important event is checked first
if has_winning_score && player_score == Settings.winning_score:
winner_triggered.emit()
elif has_winning_score && player_score == Settings.winning_score - 1:
match_point_triggered.emit()
elif first_point:
first_point_triggered.emit()
else:
point_given_sound.emit()
func minus_point() -> void: