Put the whole look into one project theme
Build / test (pull_request) Successful in 31s
Build / build (pull_request) Skipped
Build / test (push) Successful in 31s
Build / build (push) Successful in 1m13s

themes/main_theme.tres is the project theme. It holds Godot's default look for
every control type the game uses, plus named styles for the game's own look
(popups, the background, spacers, list rows, title and text sizes, highlights)
and a palette for the popup dimming. Scenes and scripts name these styles
instead of setting colours, sizes or style boxes, and the five old theme files
are gone. themes/README.md explains the styles and how to make a new theme.

The screenshot tour now uses the real character pictures, so the layout
baseline is taken again. Screenshots are pixel-identical to before, and
test_theme.gd checks that the look stays in the theme.
This commit was merged in pull request #36.
This commit is contained in:
Sansan committed 2026-10-06 13:33:35 +02:00
1 parent a7bf38c5f9
commit 8b71723a34
39 files changed
+3283 -1869

No files matched your search

+4 -9
View File
@@ -25,15 +25,12 @@ var shortcuts_dic: Dictionary = {
@onready var shortcuts_panel: Panel = %ShortcutsPanel
#Color(0.18, 0.18, 0.18)
#Color(0.302, 0.302, 0.302)
#Color(0.259, 0.259, 0.259)
func _ready() -> void:
shortcuts_dic.sort()
Settings.delete_children(shortcuts_vbox)
var title: Label = Label.new()
title.add_theme_font_size_override("font_size", 20)
title.theme_type_variation = &"TextLarge"
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
title.text = "Shortcuts"
shortcuts_vbox.add_child(title)
@@ -45,23 +42,21 @@ func _ready() -> void:
hbox.alignment = BoxContainer.ALIGNMENT_CENTER
var label: Label = Label.new()
label.add_theme_font_size_override("font_size", 20)
label.theme_type_variation = &"TextLarge"
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
label.text = shortcut
label.autowrap_mode = TextServer.AUTOWRAP_WORD
label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
var label2: Label = Label.new()
label2.add_theme_font_size_override("font_size", 20)
label2.theme_type_variation = &"TextLarge"
label2.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
label2.text = shortcuts_dic[shortcut]
label2.autowrap_mode = TextServer.AUTOWRAP_WORD
label2.size_flags_horizontal = Control.SIZE_EXPAND_FILL
if count % 2 == 0:
var new_stylebox_normal: Resource = panel.get_theme_stylebox("panel").duplicate()
new_stylebox_normal.bg_color = Color(0.18, 0.18, 0.18)
panel.add_theme_stylebox_override("panel", new_stylebox_normal)
panel.theme_type_variation = &"ShortcutRowDark"
hbox.add_child(label)
hbox.add_child(label2)