Add a theme picker and an Original web theme (#42)
Settings has a Theme row listing Settings.THEMES: Classic (main_theme.tres, still the default) and Original web (original_web_theme.tres), which looks like MusicFrontend: orange-bordered buttons, a #333 header and popups, #424242 panels, #4e4e4e alternating rows, a yellow playing song and a light grey player bar. Picking one sets the root window's theme at once and saves it as theme_id in settings.cfg, and it is applied at start. The popup backdrop and score graph follow a theme switch. The top bar has its own TopBarBackground style. test_theme.gd checks that every theme has everything main_theme.tres has. The screenshot tool takes a theme id. Closes #42 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
70e970b24c
commit
94e8dfb602
15 files changed
+2497
-586
No files matched your search
@@ -3,6 +3,7 @@ extends SceneTree
|
||||
##
|
||||
## Usage:
|
||||
## MUSICPLAYER_CONFIG_DIR=$(mktemp -d) godot --path . -s tools/take_screenshots.gd -- <dir>
|
||||
## [<theme id>]
|
||||
##
|
||||
## Setting [code]MUSICPLAYER_CONFIG_DIR[/code] keeps your saved quiz settings out of the
|
||||
## pictures.
|
||||
@@ -10,6 +11,9 @@ extends SceneTree
|
||||
## Writes [code]<state>.png[/code] for each state and [code]layout.json[/code] with where
|
||||
## every node is in each state. With [code]--headless[/code] only the layout is written.
|
||||
## Compare two runs with [code]tools/compare_screenshots.py[/code].
|
||||
##
|
||||
## The pictures use the default theme, or the theme with the given id from
|
||||
## [code]Settings.THEMES[/code], e.g. [code]original_web[/code].
|
||||
|
||||
const SIZE: Vector2i = Vector2i(1920, 1080)
|
||||
|
||||
@@ -37,6 +41,10 @@ func _take() -> void:
|
||||
viewport.render_target_update_mode = SubViewport.UPDATE_ALWAYS
|
||||
root.add_child(viewport)
|
||||
var main: Control = load("res://main/MainWindow.tscn").instantiate()
|
||||
if args.size() > 1:
|
||||
# The game sets the root window's theme, which the viewport here is not under
|
||||
var settings: Node = root.get_node("Settings")
|
||||
main.theme = load(settings.theme_entry(args[1]).path)
|
||||
viewport.add_child(main)
|
||||
|
||||
var layout: Dictionary = {}
|
||||
|
||||
Reference in new issue
Block a user