feat(theme): TitleLogo + TitleKicker display variations

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-11 10:41:42 -05:00
parent 263254346d
commit c6d513c966
5 changed files with 36 additions and 0 deletions

View File

@@ -486,3 +486,11 @@ TabActive/styles/focus = SubResource("StyleBoxEmpty_wmbj4")
TabActive/styles/hover = SubResource("StyleBoxFlat_xdylb")
TabActive/styles/normal = SubResource("StyleBoxFlat_pjnll")
TabActive/styles/pressed = SubResource("StyleBoxFlat_klelq")
TitleKicker/base_type = &"Label"
TitleKicker/colors/font_color = Color(0.6627451, 0.5176471, 0.24705882, 1)
TitleKicker/font_sizes/font_size = 13
TitleKicker/fonts/font = ExtResource("2_4lwr2")
TitleLogo/base_type = &"Label"
TitleLogo/colors/font_color = Color(0.9098039, 0.8666667, 0.78431374, 1)
TitleLogo/font_sizes/font_size = 116
TitleLogo/fonts/font = ExtResource("3_eckwq")

View File

@@ -34,6 +34,7 @@ func _init() -> void:
static func build_theme() -> Theme:
var theme := Theme.new()
_fonts(theme)
_title_type(theme)
_rich_text(theme)
_primary_cta(theme)
_tabs(theme)
@@ -80,6 +81,20 @@ static func _fonts(theme: Theme) -> void:
theme.set_color(&"font_color", ThemeKeys.MONO, Palette.MUTED_MONO)
static func _title_type(theme: Theme) -> void:
# Title-screen display type (mock Title Screen): the big serif logo + the mono
# kicker above it. Label font-role variations (font/size/colour), the same
# shape as Heading/Accent/Mono.
theme.set_type_variation(ThemeKeys.TITLE_LOGO, "Label")
theme.set_font(&"font", ThemeKeys.TITLE_LOGO, load(SERIF))
theme.set_font_size(&"font_size", ThemeKeys.TITLE_LOGO, 116)
theme.set_color(&"font_color", ThemeKeys.TITLE_LOGO, Palette.CREAM)
theme.set_type_variation(ThemeKeys.TITLE_KICKER, "Label")
theme.set_font(&"font", ThemeKeys.TITLE_KICKER, load(MONO))
theme.set_font_size(&"font_size", ThemeKeys.TITLE_KICKER, 13)
theme.set_color(&"font_color", ThemeKeys.TITLE_KICKER, Palette.GOLD)
static func _rich_text(theme: Theme) -> void:
# Base RichTextLabel styling — the narrative "prose" voice (mock README §Typography:
# Georgia/serif for DM/flavor body, italic for emphasis). RichTextLabel does NOT

View File

@@ -22,6 +22,8 @@ const DARK_PANEL := &"DarkPanel"
const HEADING := &"Heading"
const ACCENT := &"Accent"
const MONO := &"Mono"
const TITLE_LOGO := &"TitleLogo"
const TITLE_KICKER := &"TitleKicker"
## Every variation name + the base Control type it decorates. The builder and the
## test both iterate this so they can never drift apart.

View File

@@ -0,0 +1,10 @@
extends "res://addons/gut/test.gd"
const Builder = preload("res://scripts/theme/build_game_theme.gd")
func test_title_variations_built():
var t: Theme = Builder.build_theme()
assert_eq(t.get_font_size(&"font_size", ThemeKeys.TITLE_LOGO), 116)
assert_eq(t.get_color(&"font_color", ThemeKeys.TITLE_LOGO), Palette.CREAM)
assert_eq(t.get_color(&"font_color", ThemeKeys.TITLE_KICKER), Palette.GOLD)

View File

@@ -0,0 +1 @@
uid://dbqle1sf0byj4