fix(theme): drop redundant const preloads shadowing global class_names
palette.gd / theme_keys.gd already declare `class_name`, so `const Palette =
preload(...)` in every consumer shadowed the global class and emitted 4
editor errors ("has the same name as a global class"). Reference the global
class_names directly. Editor reload now clean; suite 125/125; runtime probe
still builds all 75 showcase nodes with the theme applied.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,8 +13,6 @@ extends SceneTree
|
|||||||
## — so this is safe to call from a test without side effects.
|
## — so this is safe to call from a test without side effects.
|
||||||
## §2: presentation.
|
## §2: presentation.
|
||||||
|
|
||||||
const Palette = preload("res://scripts/theme/palette.gd")
|
|
||||||
const ThemeKeys = preload("res://scripts/theme/theme_keys.gd")
|
|
||||||
|
|
||||||
const OUT := "res://assets/theme/game_theme.tres"
|
const OUT := "res://assets/theme/game_theme.tres"
|
||||||
const SERIF := "res://assets/theme/fonts/EBGaramond-VariableFont_wght.ttf"
|
const SERIF := "res://assets/theme/fonts/EBGaramond-VariableFont_wght.ttf"
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ extends Panel
|
|||||||
## Uniforms are set at runtime from Palette (deliberate deviation from spec §5.4's
|
## Uniforms are set at runtime from Palette (deliberate deviation from spec §5.4's
|
||||||
## "baked into the .tscn/material" approach) — keeps Palette the single source of
|
## "baked into the .tscn/material" approach) — keeps Palette the single source of
|
||||||
## truth at the cost of an editor preview; the surface renders once the scene runs.
|
## truth at the cost of an editor preview; the surface renders once the scene runs.
|
||||||
const Palette = preload("res://scripts/theme/palette.gd")
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ extends Panel
|
|||||||
## Uniforms are set at runtime from Palette (deliberate deviation from spec §5.4's
|
## Uniforms are set at runtime from Palette (deliberate deviation from spec §5.4's
|
||||||
## "baked into the .tscn/material" approach) — keeps Palette the single source of
|
## "baked into the .tscn/material" approach) — keeps Palette the single source of
|
||||||
## truth at the cost of an editor preview; the surface renders once the scene runs.
|
## truth at the cost of an editor preview; the surface renders once the scene runs.
|
||||||
const Palette = preload("res://scripts/theme/palette.gd")
|
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
extends Control
|
extends Control
|
||||||
## The eyeball proof for the shared Theme (spec §7). Builds every token, stylebox,
|
## The eyeball proof for the shared Theme (spec §7). Builds every token, stylebox,
|
||||||
## font, surface, and bar on one scrollable screen. No AI, no state. §2: presentation.
|
## font, surface, and bar on one scrollable screen. No AI, no state. §2: presentation.
|
||||||
const Palette = preload("res://scripts/theme/palette.gd")
|
|
||||||
const ThemeKeys = preload("res://scripts/theme/theme_keys.gd")
|
|
||||||
const GAME_THEME := "res://assets/theme/game_theme.tres"
|
const GAME_THEME := "res://assets/theme/game_theme.tres"
|
||||||
const SERIF_ITALIC := "res://assets/theme/fonts/EBGaramond-Italic-VariableFont_wght.ttf"
|
const SERIF_ITALIC := "res://assets/theme/fonts/EBGaramond-Italic-VariableFont_wght.ttf"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
extends "res://addons/gut/test.gd"
|
extends "res://addons/gut/test.gd"
|
||||||
|
|
||||||
const Palette = preload("res://scripts/theme/palette.gd")
|
|
||||||
|
|
||||||
|
|
||||||
func test_core_tokens_are_colors():
|
func test_core_tokens_are_colors():
|
||||||
assert_true(Palette.BLOOD is Color)
|
assert_true(Palette.BLOOD is Color)
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# client/tests/unit/test_theme_resource.gd
|
# client/tests/unit/test_theme_resource.gd
|
||||||
extends "res://addons/gut/test.gd"
|
extends "res://addons/gut/test.gd"
|
||||||
|
|
||||||
const ThemeKeys = preload("res://scripts/theme/theme_keys.gd")
|
|
||||||
const Builder = preload("res://scripts/theme/build_game_theme.gd")
|
const Builder = preload("res://scripts/theme/build_game_theme.gd")
|
||||||
const THEME_PATH := "res://assets/theme/game_theme.tres"
|
const THEME_PATH := "res://assets/theme/game_theme.tres"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user