From b26116acc9531db58470d1e9d57f0c77fd6d0182 Mon Sep 17 00:00:00 2001 From: Natalie Date: Fri, 19 Jun 2026 02:50:37 -0500 Subject: [PATCH] =?UTF-8?q?refactor(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=8E=A8=20knowledge=5Ftree=20labels=20inherit=20via=20them?= =?UTF-8?q?e=5Ftype=5Fvariation=20(p2-87=20pilot)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First override→inheritance migration, proving the pattern. Replace 4 add_theme_color_override("font_color", ...) calls with theme_type_variation: cost→LabelMuted, hint→LabelDisabled, title→LabelTitle, flavor→LabelSecondary. Widgets now inherit the colour from ui_theme.tres instead of hand-setting it. Value-preserving (variations carry the same token colours). Render-verified on plum via tech_tree_proof — cost labels render the muted colour correctly, tree unchanged. Remaining accent-param labels (_make_pill/_make_section) stay as overrides (dynamic colour). The redundant text.primary overrides (= Label default) are a separate delete-pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/game/engine/scenes/knowledge_tree/knowledge_tree.gd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/engine/scenes/knowledge_tree/knowledge_tree.gd b/src/game/engine/scenes/knowledge_tree/knowledge_tree.gd index b1e287f7..4888c8cf 100644 --- a/src/game/engine/scenes/knowledge_tree/knowledge_tree.gd +++ b/src/game/engine/scenes/knowledge_tree/knowledge_tree.gd @@ -466,7 +466,7 @@ func _create_node_card( var cost_label: Label = Label.new() cost_label.text = "%s: %d" % [ThemeVocabulary.lookup(_cost_unit_vocab_key()), cost] cost_label.add_theme_font_size_override("font_size", 12) - cost_label.add_theme_color_override("font_color", ThemeAssets.color("text.muted")) + cost_label.theme_type_variation = "LabelMuted" inner_vbox.add_child(cost_label) var counts: Dictionary = _count_unlocks(node_data.get("unlocks", {})) @@ -575,7 +575,7 @@ func _rebuild_detail() -> void: if _web == null or _selected_node_id.is_empty(): var hint: Label = Label.new() hint.text = _hint_text() - hint.add_theme_color_override("font_color", ThemeAssets.color("text.disabled")) + hint.theme_type_variation = "LabelDisabled" hint.add_theme_font_size_override("font_size", 12) hint.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART hint.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER @@ -592,7 +592,7 @@ func _rebuild_detail() -> void: node_name = String(node_data.get("name", _selected_node_id)) title.text = node_name title.add_theme_font_size_override("font_size", 20) - title.add_theme_color_override("font_color", ThemeAssets.color("text.title")) + title.theme_type_variation = "LabelTitle" title.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART _detail_vbox.add_child(title) @@ -759,7 +759,7 @@ func _make_flavor_block(text: String) -> PanelContainer: var lbl: Label = Label.new() lbl.text = text lbl.add_theme_font_size_override("font_size", 12) - lbl.add_theme_color_override("font_color", ThemeAssets.color("text.secondary")) + lbl.theme_type_variation = "LabelSecondary" lbl.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART p.add_child(lbl) return p