fix(theme): drift-guard test, interactive stylebox states, ThemeKeys font consts, richer showcase (whole-branch review)
- build_game_theme.gd: extract build_theme() as a static func returning the fully-built Theme; _init() is now a thin save+quit wrapper. Enables a test to build a fresh Theme in memory without running the SceneTree main loop. - test_theme_resource.gd: add test_committed_tres_matches_builder() — builds a fresh Theme via the preloaded builder and compares bg_color against the committed game_theme.tres for PrimaryCTA/normal, ParchmentCard/panel, and DarkPanel/panel. Catches "palette/builder changed, .tres not regenerated." - build_game_theme.gd: give Tab, TabActive, and Chip explicit hover/pressed/ focus styleboxes (focus is StyleBoxEmpty to suppress the default ring) so they no longer fall back to Godot's default gray button on interaction. Add a disabled stylebox + font_disabled_color to PrimaryCTA for the unaffordable-CTA state the 2a shell will need. - theme_keys.gd: add HEADING/ACCENT/MONO font-role consts (kept out of ALL, which is stylebox-variation-only); build_game_theme.gd and theme_showcase.gd now reference them instead of raw StringName literals. - theme_showcase.gd: add an italic DM-voice RichTextLabel (EB Garamond italic face, spec §6) and two semantic-coloured chips (BLOOD for aggressive actions, GOLD for pay/faith) alongside the existing neutral chip, demonstrating the script-applied colouring from spec §5.3. - dark_bay.gdshader: comment noting the stripe uses FRAGCOORD (screen-space) while the vignette uses UV (node-local) — intended for full-bleed use. - surfaces/*.gd: ## comments documenting the accepted deviation from spec §5.4 (uniforms set at runtime from Palette rather than baked into the .tscn) — no behavior change. - Regenerated game_theme.tres via build_game_theme.gd. Full suite: 125/125 (was 124, +1 drift-guard test). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GFDm1ku9WDUacK2S78m2be
This commit is contained in:
@@ -4,7 +4,25 @@
|
||||
[ext_resource type="FontFile" path="res://assets/theme/fonts/JetBrainsMono-VariableFont_wght.ttf" id="2_605w4"]
|
||||
[ext_resource type="FontFile" path="res://assets/theme/fonts/EBGaramond-VariableFont_wght.ttf" id="3_4lwr2"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_eckwq"]
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_eckwq"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_i0b23"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
content_margin_bottom = 6.0
|
||||
bg_color = Color(0.6039216, 0.56078434, 0.47058824, 0.22)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.6039216, 0.56078434, 0.47058824, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cqbvn"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -20,7 +38,23 @@ corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_i0b23"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q5gpk"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
content_margin_bottom = 6.0
|
||||
bg_color = Color(0.6039216, 0.56078434, 0.47058824, 0.32)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.6039216, 0.56078434, 0.47058824, 1)
|
||||
corner_radius_top_left = 3
|
||||
corner_radius_top_right = 3
|
||||
corner_radius_bottom_right = 3
|
||||
corner_radius_bottom_left = 3
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bbpmc"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -36,7 +70,7 @@ corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cqbvn"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_73lme"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -52,7 +86,7 @@ corner_radius_top_right = 6
|
||||
corner_radius_bottom_right = 6
|
||||
corner_radius_bottom_left = 6
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q5gpk"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_js3tr"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -69,7 +103,7 @@ corner_radius_top_right = 6
|
||||
corner_radius_bottom_right = 6
|
||||
corner_radius_bottom_left = 6
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bbpmc"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ube3r"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -85,7 +119,7 @@ corner_radius_top_right = 6
|
||||
corner_radius_bottom_right = 6
|
||||
corner_radius_bottom_left = 6
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_73lme"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2tooq"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -101,7 +135,23 @@ corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_js3tr"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4kten"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
content_margin_bottom = 6.0
|
||||
bg_color = Color(0.47843137, 0.4392157, 0.3764706, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.47843137, 0.4392157, 0.3764706, 1)
|
||||
corner_radius_top_left = 4
|
||||
corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p6wtm"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -117,7 +167,7 @@ corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ube3r"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0fjdt"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -133,7 +183,7 @@ corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_2tooq"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ns3kg"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -149,7 +199,25 @@ corner_radius_top_right = 4
|
||||
corner_radius_bottom_right = 4
|
||||
corner_radius_bottom_left = 4
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4kten"]
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_jly1r"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_lw8lk"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
content_margin_bottom = 6.0
|
||||
bg_color = Color(0.94509804, 0.9098039, 0.8235294, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.79607844, 0.7137255, 0.5176471, 1)
|
||||
corner_radius_top_left = 14
|
||||
corner_radius_top_right = 14
|
||||
corner_radius_bottom_right = 14
|
||||
corner_radius_bottom_left = 14
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nh0e7"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -165,7 +233,41 @@ corner_radius_top_right = 14
|
||||
corner_radius_bottom_right = 14
|
||||
corner_radius_bottom_left = 14
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_p6wtm"]
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_dtr07"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
content_margin_bottom = 6.0
|
||||
bg_color = Color(0.9019608, 0.8509804, 0.72156864, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.7490196, 0.65882355, 0.47058824, 1)
|
||||
corner_radius_top_left = 14
|
||||
corner_radius_top_right = 14
|
||||
corner_radius_bottom_right = 14
|
||||
corner_radius_bottom_left = 14
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nmowx"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_oi067"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
content_margin_bottom = 6.0
|
||||
bg_color = Color(0.72156864, 0.32156864, 0.2901961, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.72156864, 0.32156864, 0.2901961, 1)
|
||||
corner_radius_top_left = 14
|
||||
corner_radius_top_right = 14
|
||||
corner_radius_bottom_right = 14
|
||||
corner_radius_bottom_left = 14
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ukblj"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
@@ -181,6 +283,22 @@ corner_radius_top_right = 14
|
||||
corner_radius_bottom_right = 14
|
||||
corner_radius_bottom_left = 14
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_utt73"]
|
||||
content_margin_left = 12.0
|
||||
content_margin_top = 6.0
|
||||
content_margin_right = 12.0
|
||||
content_margin_bottom = 6.0
|
||||
bg_color = Color(0.47843137, 0.18431373, 0.16078432, 1)
|
||||
border_width_left = 1
|
||||
border_width_top = 1
|
||||
border_width_right = 1
|
||||
border_width_bottom = 1
|
||||
border_color = Color(0.56078434, 0.22745098, 0.20392157, 1)
|
||||
corner_radius_top_left = 14
|
||||
corner_radius_top_right = 14
|
||||
corner_radius_bottom_right = 14
|
||||
corner_radius_bottom_left = 14
|
||||
|
||||
[resource]
|
||||
default_font = ExtResource("3_4lwr2")
|
||||
default_font_size = 18
|
||||
@@ -192,33 +310,44 @@ Chip/base_type = &"Button"
|
||||
Chip/colors/font_color = Color(0.6039216, 0.56078434, 0.47058824, 1)
|
||||
Chip/font_sizes/font_size = 11
|
||||
Chip/fonts/font = ExtResource("2_605w4")
|
||||
Chip/styles/normal = SubResource("StyleBoxFlat_eckwq")
|
||||
Chip/styles/focus = SubResource("StyleBoxEmpty_eckwq")
|
||||
Chip/styles/hover = SubResource("StyleBoxFlat_i0b23")
|
||||
Chip/styles/normal = SubResource("StyleBoxFlat_cqbvn")
|
||||
Chip/styles/pressed = SubResource("StyleBoxFlat_q5gpk")
|
||||
DarkPanel/base_type = &"PanelContainer"
|
||||
DarkPanel/styles/panel = SubResource("StyleBoxFlat_i0b23")
|
||||
DarkPanel/styles/panel = SubResource("StyleBoxFlat_bbpmc")
|
||||
Heading/base_type = &"Label"
|
||||
Heading/colors/font_color = Color(0.22745098, 0.18431373, 0.10980392, 1)
|
||||
Heading/font_sizes/font_size = 34
|
||||
Heading/fonts/font = ExtResource("3_4lwr2")
|
||||
ItemTile/base_type = &"PanelContainer"
|
||||
ItemTile/styles/panel = SubResource("StyleBoxFlat_cqbvn")
|
||||
ItemTile/styles/panel = SubResource("StyleBoxFlat_73lme")
|
||||
ItemTileEmpty/base_type = &"PanelContainer"
|
||||
ItemTileEmpty/styles/panel = SubResource("StyleBoxFlat_q5gpk")
|
||||
ItemTileEmpty/styles/panel = SubResource("StyleBoxFlat_js3tr")
|
||||
Mono/base_type = &"Label"
|
||||
Mono/colors/font_color = Color(0.6039216, 0.56078434, 0.47058824, 1)
|
||||
Mono/font_sizes/font_size = 13
|
||||
Mono/fonts/font = ExtResource("2_605w4")
|
||||
ParchmentCard/base_type = &"PanelContainer"
|
||||
ParchmentCard/styles/panel = SubResource("StyleBoxFlat_bbpmc")
|
||||
ParchmentCard/styles/panel = SubResource("StyleBoxFlat_ube3r")
|
||||
ParchmentInset/base_type = &"PanelContainer"
|
||||
ParchmentInset/styles/panel = SubResource("StyleBoxFlat_73lme")
|
||||
ParchmentInset/styles/panel = SubResource("StyleBoxFlat_2tooq")
|
||||
PrimaryCTA/base_type = &"Button"
|
||||
PrimaryCTA/colors/font_color = Color(0.9411765, 0.9019608, 0.8156863, 1)
|
||||
PrimaryCTA/styles/hover = SubResource("StyleBoxFlat_js3tr")
|
||||
PrimaryCTA/styles/normal = SubResource("StyleBoxFlat_ube3r")
|
||||
PrimaryCTA/styles/pressed = SubResource("StyleBoxFlat_2tooq")
|
||||
PrimaryCTA/colors/font_disabled_color = Color(0.6039216, 0.56078434, 0.47058824, 1)
|
||||
PrimaryCTA/styles/disabled = SubResource("StyleBoxFlat_4kten")
|
||||
PrimaryCTA/styles/hover = SubResource("StyleBoxFlat_p6wtm")
|
||||
PrimaryCTA/styles/normal = SubResource("StyleBoxFlat_0fjdt")
|
||||
PrimaryCTA/styles/pressed = SubResource("StyleBoxFlat_ns3kg")
|
||||
Tab/base_type = &"Button"
|
||||
Tab/colors/font_color = Color(0.41568628, 0.3529412, 0.22745098, 1)
|
||||
Tab/styles/normal = SubResource("StyleBoxFlat_4kten")
|
||||
Tab/styles/focus = SubResource("StyleBoxEmpty_jly1r")
|
||||
Tab/styles/hover = SubResource("StyleBoxFlat_lw8lk")
|
||||
Tab/styles/normal = SubResource("StyleBoxFlat_nh0e7")
|
||||
Tab/styles/pressed = SubResource("StyleBoxFlat_dtr07")
|
||||
TabActive/base_type = &"Button"
|
||||
TabActive/colors/font_color = Color(0.9411765, 0.9019608, 0.8156863, 1)
|
||||
TabActive/styles/normal = SubResource("StyleBoxFlat_p6wtm")
|
||||
TabActive/styles/focus = SubResource("StyleBoxEmpty_nmowx")
|
||||
TabActive/styles/hover = SubResource("StyleBoxFlat_oi067")
|
||||
TabActive/styles/normal = SubResource("StyleBoxFlat_ukblj")
|
||||
TabActive/styles/pressed = SubResource("StyleBoxFlat_utt73")
|
||||
|
||||
@@ -4,6 +4,11 @@ uniform vec4 stripe_b : source_color;
|
||||
uniform float band_px = 16.0; // 16px bands per README
|
||||
uniform float vignette = 0.55; // edge darkening strength
|
||||
void fragment() {
|
||||
// Coordinate spaces differ on purpose: the stripe uses FRAGCOORD (screen-space,
|
||||
// not node-local), while the vignette below uses UV (node-local, 0..1 across
|
||||
// this node's rect). An offset DarkBay instance therefore keeps its stripes
|
||||
// anchored to the screen rather than restarting at the node's own origin —
|
||||
// intended for full-bleed use.
|
||||
// 135deg diagonal stripe: sum of pixel coords, banded.
|
||||
vec2 px = FRAGCOORD.xy;
|
||||
float diag = px.x + px.y;
|
||||
|
||||
Reference in New Issue
Block a user