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
@@ -1,9 +1,9 @@
|
||||
class_name SettingsPopup
|
||||
extends BasePopup
|
||||
## The application settings: which MusicServer or music folder to play from, fullscreen,
|
||||
## how many songs to download ahead, whether to prefer less played soundtracks and whether
|
||||
## plays count in the statistics, and a button that opens the folder the settings are
|
||||
## kept in. Opened from the Settings button in the top bar.
|
||||
## The application settings: which MusicServer or music folder to play from, the theme,
|
||||
## fullscreen, how many songs to download ahead, whether to prefer less played soundtracks
|
||||
## and whether plays count in the statistics, and a button that opens the folder the
|
||||
## settings are kept in. Opened from the Settings button in the top bar.
|
||||
##
|
||||
## A music folder (see [MusicFolder]) is used instead of the server until Use server is
|
||||
## pressed or the game is closed. The settings that need the server are off meanwhile.
|
||||
@@ -25,6 +25,7 @@ const PADDING: Vector2 = Vector2(20, 12)
|
||||
@onready var settings_panel: Panel = %SettingsPanel
|
||||
@onready var select_server_button: OptionButton = %SelectServerButton
|
||||
@onready var fullscreen_button: CheckButton = %FullscreenButton
|
||||
@onready var theme_button: OptionButton = %ThemeButton
|
||||
@onready var cache_label: Label = %CacheLabel
|
||||
@onready var lower_cache_button: Button = %LowerCacheButton
|
||||
@onready var increase_cache_button: Button = %IncreaseCacheButton
|
||||
@@ -56,6 +57,10 @@ var _panel_middle_y: float = 0.0
|
||||
func _ready() -> void:
|
||||
for server: String in Settings.servers:
|
||||
select_server_button.add_item(server)
|
||||
for entry: Dictionary in Settings.THEMES:
|
||||
theme_button.add_item(entry.name)
|
||||
theme_button.select(Settings.THEMES.find(Settings.theme_entry(Settings.theme_id)))
|
||||
theme_button.item_selected.connect(select_theme)
|
||||
fullscreen_button.button_pressed = Settings.fullscreen
|
||||
select_server_button.select(Settings.selected_server)
|
||||
cache_label.text = str(Playlist.number_of_tracks_to_preload)
|
||||
@@ -83,6 +88,11 @@ func _ready() -> void:
|
||||
_show_music_source()
|
||||
|
||||
|
||||
## Switches to the theme at [param index] in [constant Settings.THEMES] at once.
|
||||
func select_theme(index: int) -> void:
|
||||
Settings.apply_theme(Settings.THEMES[index].id)
|
||||
|
||||
|
||||
func fullscreen() -> void:
|
||||
Settings.set_fullscreen(!Settings.fullscreen)
|
||||
|
||||
|
||||
Reference in new issue
Block a user