refactor(@projects/@magic-civilization): 🎨 top_bar happiness label → conditional theme_type_variation (p2-87)
Migrate the %HappinessLabel state-conditional font_color (positive/negative/
neutral) to theme_type_variation (LabelPositive/Negative/Secondary). It's a
Label (top_bar.tscn:86), so the variation applies cleanly and is value-preserving.
This completes the static Label font_color override→inheritance migration. The
only remaining add_theme_color_override("font_color", ...) are 2 Button
state-toggles (lens_switcher active-lens, overlay_panel) — genuinely dynamic
(toggled per UI state, would need a Button-based variation), left as the
dynamic carve-out.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
6a3bc95b06
commit
3942adf26b
1 changed files with 3 additions and 3 deletions
|
|
@ -150,11 +150,11 @@ func _update_happiness(value: int) -> void:
|
|||
var status_label: String = ThemeVocabulary.lookup("happiness_status_" + status)
|
||||
%HappinessLabel.text = ThemeVocabulary.lookup("fmt_top_bar_dot") % [status_label, _format_signed(value)]
|
||||
if value > 0:
|
||||
%HappinessLabel.add_theme_color_override("font_color", ThemeAssets.color("semantic.positive"))
|
||||
%HappinessLabel.theme_type_variation = "LabelPositive"
|
||||
elif value < 0:
|
||||
%HappinessLabel.add_theme_color_override("font_color", ThemeAssets.color("semantic.negative"))
|
||||
%HappinessLabel.theme_type_variation = "LabelNegative"
|
||||
else:
|
||||
%HappinessLabel.add_theme_color_override("font_color", ThemeAssets.color("text.secondary"))
|
||||
%HappinessLabel.theme_type_variation = "LabelSecondary"
|
||||
|
||||
|
||||
func _update_golden_age_badge() -> void:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue