Save the quiz and continue it after a restart; load characters from a folder
The quiz is saved to current_quiz.json in the config folder after every change, and the game goes on where it was when it starts again: the players with their points and characters, every song with who got a point for it and whether it was played, answered or is playing, and the songs downloaded ahead with their files. The song that was playing is ready to play again. Songs whose files are gone are downloaded again. On a server, the saved songs are checked against the server's playlist. If it changed, e.g. after a sync, or another server is used, the quiz starts over with the same players. A quiz from a music folder continues offline, including how far a prepared quiz has come. A new game is saved like any other change, and a file that can't be read starts a new quiz. Characters can be read from a folder picked in Settings instead of the server, for this session. A music folder with a characters folder brings its own characters, e.g. for a themed quiz; that folder is not counted as a soundtrack. When the characters come from somewhere else, players pick their characters again. Closes #11, closes #44
This commit is contained in:
1 parent
4a934840f6
commit
e4352a9f34
33 files changed
+2886
-499
No files matched your search
@@ -88,6 +88,9 @@ var last_seen_version: String = ""
|
||||
## The folder songs are played from instead of the server, picked in the settings, or null
|
||||
## to use the server. Kept for this session only.
|
||||
var music_folder: MusicFolder = null
|
||||
## The folder characters are read from instead of the server, picked in the settings, or
|
||||
## empty. Kept for this session only. See [method characters_dir].
|
||||
var character_folder: String = ""
|
||||
|
||||
## The game version, set in Project Settings > Application > Config > Version.
|
||||
## Releases are made from it, see RELEASING.md.
|
||||
@@ -233,6 +236,16 @@ func is_prepared_quiz() -> bool:
|
||||
return music_folder != null && music_folder.kind == MusicFolder.Kind.PREPARED_QUIZ
|
||||
|
||||
|
||||
## The folder the characters come from, or empty for the server's: the folder picked in
|
||||
## the settings, otherwise the [code]characters[/code] folder of the music folder played.
|
||||
func characters_dir() -> String:
|
||||
if !character_folder.is_empty():
|
||||
return character_folder
|
||||
if music_folder != null:
|
||||
return music_folder.characters_path
|
||||
return ""
|
||||
|
||||
|
||||
func delete_children(node: Node) -> void:
|
||||
for n: Node in node.get_children():
|
||||
node.remove_child(n)
|
||||
|
||||
Reference in new issue
Block a user