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

+69 -7
View File
@@ -16,7 +16,7 @@ panel = NodePath("SettingsPanel")
unique_name_in_owner = true
layout_mode = 0
offset_right = 520.0
offset_bottom = 242.0
offset_bottom = 270.0
theme_type_variation = &"PopupBackground"
[node name="VBoxContainer" type="VBoxContainer" parent="SettingsPanel" unique_id=1796635163]
@@ -25,7 +25,7 @@ layout_mode = 0
offset_left = 20.0
offset_top = 12.0
offset_right = 500.0
offset_bottom = 230.0
offset_bottom = 258.0
[node name="Label" type="Label" parent="SettingsPanel/VBoxContainer" unique_id=1111531402]
layout_mode = 2
@@ -47,6 +47,65 @@ layout_mode = 2
size_flags_horizontal = 3
focus_mode = 0
[node name="FolderRow" type="HBoxContainer" parent="SettingsPanel/VBoxContainer"]
layout_mode = 2
[node name="Title" type="Label" parent="SettingsPanel/VBoxContainer/FolderRow"]
layout_mode = 2
theme_type_variation = &"SettingsRowLabel"
text = "Music folder"
[node name="FolderLabel" type="Label" parent="SettingsPanel/VBoxContainer/FolderRow"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
mouse_filter = 1
text = "None, using the server"
text_overrun_behavior = 3
[node name="ChooseFolderButton" type="Button" parent="SettingsPanel/VBoxContainer/FolderRow"]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 0
text = "Choose…"
[node name="UseServerButton" type="Button" parent="SettingsPanel/VBoxContainer/FolderRow"]
unique_name_in_owner = true
visible = false
layout_mode = 2
focus_mode = 0
text = "Use server"
[node name="FolderErrorLabel" type="Label" parent="SettingsPanel/VBoxContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
theme_type_variation = &"HighlightMedium"
text = "No songs found"
text_overrun_behavior = 3
[node name="PlayOrderRow" type="HBoxContainer" parent="SettingsPanel/VBoxContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
[node name="Title" type="Label" parent="SettingsPanel/VBoxContainer/PlayOrderRow"]
layout_mode = 2
size_flags_horizontal = 3
theme_type_variation = &"SettingsRowLabel"
text = "Play the prepared quiz"
[node name="PlayOrderButton" type="OptionButton" parent="SettingsPanel/VBoxContainer/PlayOrderRow"]
unique_name_in_owner = true
layout_mode = 2
focus_mode = 0
selected = 0
item_count = 2
popup/item_0/text = "In order"
popup/item_0/id = 0
popup/item_1/text = "At random"
popup/item_1/id = 1
[node name="FullscreenButton" type="CheckButton" parent="SettingsPanel/VBoxContainer" unique_id=400304684]
unique_name_in_owner = true
layout_mode = 2
@@ -99,9 +158,12 @@ focus_mode = 0
action_mode = 0
text = "Count plays in statistics"
[node name="LocalButton" type="CheckButton" parent="SettingsPanel/VBoxContainer" unique_id=905844805]
[node name="FolderDialog" type="FileDialog" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 2
disabled = true
text = "Local"
title = "Choose a music folder"
initial_position = 2
size = Vector2i(800, 500)
ok_button_text = "Select Current Folder"
file_mode = 2
access = 2
use_native_dialog = true