Show a graph of the game on the Winner popup
The Winner popup now shows every player's score after each song as a step line, with the winning score marked, and three facts under it: the longest streak, the longest standstill and the song most players scored on. The data comes from the points each song already records, through the new ScoreHistory. The popup grows to 1600x920 with the graph across the full width, so a 60-song game with five players stays readable. Reset points now starts a new game: it clears the points on the songs and the graph starts after the song that was playing. Songs already on the server at startup count as an earlier game. The screenshot tour has a long five-player game, and only the Winner popup differs from before.
This commit is contained in:
1 parent
b40b160fde
commit
e1e05f3904
21 files changed
+2461
-182
No files matched your search
@@ -36,6 +36,15 @@ const STYLES: Dictionary = {
|
||||
"TabButton": "Button",
|
||||
}
|
||||
|
||||
## Theme types that only scripts read from, so they are not styles a node can pick.
|
||||
const CODE_ONLY_TYPES: Dictionary = {
|
||||
"Palette": ["backdrop"],
|
||||
"ScoreGraph": [
|
||||
"player_1", "player_2", "player_3", "player_4", "player_5", "player_6", "player_7",
|
||||
"grid", "axis_text", "winning_line",
|
||||
],
|
||||
}
|
||||
|
||||
var _theme: Theme = load(THEME_PATH)
|
||||
|
||||
|
||||
@@ -79,8 +88,11 @@ func test_theme_has_every_named_style() -> void:
|
||||
.is_equal(STYLES[style])
|
||||
|
||||
|
||||
func test_theme_has_the_palette() -> void:
|
||||
assert_bool(_theme.has_color("backdrop", "Palette")).is_true()
|
||||
func test_theme_has_the_colours_scripts_use() -> void:
|
||||
for type: String in CODE_ONLY_TYPES:
|
||||
for color: String in CODE_ONLY_TYPES[type]:
|
||||
assert_bool(_theme.has_color(color, type)) \
|
||||
.override_failure_message("%s/%s is missing" % [type, color]).is_true()
|
||||
|
||||
|
||||
func test_every_style_named_in_scenes_and_scripts_exists() -> void:
|
||||
@@ -89,7 +101,7 @@ func test_every_style_named_in_scenes_and_scripts_exists() -> void:
|
||||
for path: String in _game_files(".tscn") + _game_files(".gd"):
|
||||
for found: RegExMatch in regex.search_all(FileAccess.get_file_as_string(path)):
|
||||
var style: String = found.get_string(1)
|
||||
if !(style in STYLES) && style != "Palette":
|
||||
if !(style in STYLES) && !(style in CODE_ONLY_TYPES):
|
||||
missing.append("%s: %s" % [path, style])
|
||||
assert_array(missing).override_failure_message(
|
||||
"Styles not in the theme:\n" + "\n".join(missing)).is_empty()
|
||||
|
||||
Reference in new issue
Block a user