Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.Theming.PlayerThemeValues Class Referencesealed

Holds resolved player theme values keyed by canonical framework semantic token. More...

Public Member Functions

void SetColor (string token, Color color)
 Sets one resolved colour for a framework token.
void SetNumber (string token, float value)
 Supplies a resolved numeric value without inventing a baseline.
void SetTexture (string token, Texture2D texture)
 Supplies a texture reference; null explicitly clears an image.
bool TryGetColor (string token, out Color color)
 Looks up an explicitly supplied colour without synthesizing defaults.
bool TryGetNumber (string token, out float value)
 Looks up a supplied dimension.
bool TryGetTexture (string token, out Texture2D texture)
 Looks up a supplied texture, including an explicit null image.

Properties

string FontId [get, private set]
 Gets the selected shipped font identifier, or null when no font override was supplied.

Static Private Member Functions

static bool Finite (float value)

Private Attributes

readonly Dictionary< string, Color > _colors = new Dictionary<string, Color>(StringComparer.Ordinal)
readonly Dictionary< string, float > _numbers = new Dictionary<string, float>(StringComparer.Ordinal)
readonly Dictionary< string, Texture2D > _textures = new Dictionary<string, Texture2D>(StringComparer.Ordinal)

Detailed Description

Holds resolved player theme values keyed by canonical framework semantic token.

Contains no built-in default palette. Values must be supplied by the authoritative theme snapshot or validated importer. Friendly JSON keys will map to these tokens through the shared schema catalog. This type does not deserialize or execute source.

Member Function Documentation

◆ Finite()

bool GWG.WindowFramework.Theming.PlayerThemeValues.Finite ( float value)
inlinestaticprivate
Here is the caller graph for this function:

◆ SetColor()

void GWG.WindowFramework.Theming.PlayerThemeValues.SetColor ( string token,
Color color )
inline

Sets one resolved colour for a framework token.

Parameters
tokenCanonical semantic token, not a selector or executable expression.
colorResolved finite RGBA colour.
Exceptions
ArgumentExceptionToken is empty or colour is not finite.
Here is the call graph for this function:

◆ SetNumber()

void GWG.WindowFramework.Theming.PlayerThemeValues.SetNumber ( string token,
float value )
inline

Supplies a resolved numeric value without inventing a baseline.

Parameters
tokenCanonical framework semantic token.
valueFinite dimension, or a signed offset within its catalog limits.
Exceptions
ArgumentExceptionToken is empty or value is invalid.
Here is the call graph for this function:

◆ SetTexture()

void GWG.WindowFramework.Theming.PlayerThemeValues.SetTexture ( string token,
Texture2D texture )
inline

Supplies a texture reference; null explicitly clears an image.

Parameters
tokenCanonical image token.
textureTexture owned by the importing theme, not this value model.
Exceptions
ArgumentExceptionToken is empty.

Never destroys textures. The theme owner must remove bindings before releasing them.

Here is the caller graph for this function:

◆ TryGetColor()

bool GWG.WindowFramework.Theming.PlayerThemeValues.TryGetColor ( string token,
out Color color )
inline

Looks up an explicitly supplied colour without synthesizing defaults.

Parameters
tokenCanonical semantic token.
colorSupplied colour when found.
Returns
True when present.
Here is the caller graph for this function:

◆ TryGetNumber()

bool GWG.WindowFramework.Theming.PlayerThemeValues.TryGetNumber ( string token,
out float value )
inline

Looks up a supplied dimension.

Parameters
tokenCanonical token.
valueDimension when present.
Returns
True when supplied.
Here is the caller graph for this function:

◆ TryGetTexture()

bool GWG.WindowFramework.Theming.PlayerThemeValues.TryGetTexture ( string token,
out Texture2D texture )
inline

Looks up a supplied texture, including an explicit null image.

Parameters
tokenCanonical image token.
textureOwned texture reference when present.
Returns
True when a value was supplied.
Here is the caller graph for this function:

Field Documentation

◆ _colors

readonly Dictionary<string, Color> GWG.WindowFramework.Theming.PlayerThemeValues._colors = new Dictionary<string, Color>(StringComparer.Ordinal)
private

◆ _numbers

readonly Dictionary<string, float> GWG.WindowFramework.Theming.PlayerThemeValues._numbers = new Dictionary<string, float>(StringComparer.Ordinal)
private

◆ _textures

readonly Dictionary<string, Texture2D> GWG.WindowFramework.Theming.PlayerThemeValues._textures = new Dictionary<string, Texture2D>(StringComparer.Ordinal)
private

Property Documentation

◆ FontId

string GWG.WindowFramework.Theming.PlayerThemeValues.FontId
getprivate set

Gets the selected shipped font identifier, or null when no font override was supplied.