What problem does it solve?
Variable references authored in the Gum tool are normally baked in at design time, so changing centralized style values at runtime has no effect on existing UI. This Skill explains how to re-apply those references in code so themes and shared style values propagate across all elements after the game is running.
Core Features & Use Cases
- ApplyAllVariableReferences: Extension method on GumProjectSave that iterates all standards, components, and screens, applying variable references on every state with topological ordering and graceful circular-dependency handling.
- GumExpressionService: Optional Gum.Expressions NuGet package that adds Roslyn-based evaluation of arithmetic, conditional, comparison, and logical expressions in references; without it only simple dot-path lookups work.
- Two Apply Overloads: ApplyVariableReferences can write hard values into a StateSave before UI creation, or set properties directly on live GraphicalUiElement visuals, followed by RefreshStyles to push updates.
- Use Case: Switch your game's theme at runtime by modifying centralized style variables, calling ApplyAllVariableReferences, then RefreshStyles so every control updates without recreating the UI.
Quick Start
Ask the AI to show how to apply all Gum variable references at runtime and refresh styles after changing a theme color in code.