Class UITKTheme
The set of colours a player may override, parsed once from configuration.
public sealed class UITKTheme
- Inheritance
-
UITKTheme
- Inherited Members
Remarks
The colour names and their storage format — {Name}ColorR/G/B/A as bytes — are
inherited from the theme the Canvas UI used, so a config file written by an older client
still themes this one.
But only half of it does. That inheritance was taken on the reading that the keys
name colours in the game rather than components in a scene, and for
Text, Health, Mana, Stamina, Crosshair and
TooltipLabel that holds — a health bar is red in any skin. It does not hold for the
four surface colours. Primary, Secondary, Highlight and
Background named Canvas widgets and carry that skin's greys, and applying them to
this one repaints every panel in the palette of a UI that no longer exists. A player who
once set what that panel called "Window Background" gets a grey client, having asked for
nothing of the sort.
So the surface four are honoured only from a config this skin has written, marked by VersionKey. Older entries are left on disk and ignored; setting any colour in the options panel stamps the version and brings the whole set back into force. The stamp exists because there is no other way to tell a value this skin was given from one it merely inherited — both are four bytes under the same key.
This was dormant until the store got an owner. Configuration.GlobalSettings
used to be created by whichever of two unrelated places asked for it first, and in a
client started past the launcher neither did — so the theme parsed nothing and every panel
kept its stylesheet colours. Making ClientSettings the single owner is what
first put these keys into effect, which is why a config years old could turn a UI grey the
day the loading order was fixed.
Three of that set are gone: TooltipTitle, TooltipValue and
TooltipStat. Every colour here reaches the screen by being written onto elements
carrying a particular USS class, and no element in the client carries
fish-tooltip__title or fish-tooltip__stat — the tooltip is a single label
whose internal emphasis comes from rich-text tags emitted by shared code, which cannot
reach a client-side theme. TooltipValue never had a class at all. All three were
listed in the options panel as editable colours that changed nothing when edited. A
config file that still carries their keys is simply ignored.
What did not carry over is the rest of that theme: layout spacing, padding, grid spacing, scroll sensitivity, elasticity and font auto-size bounds. Those existed because the old UI had no stylesheet — geometry could only be themed by walking components and writing fields. That is what a USS file is for now, and re-exposing them as runtime config would mean re-implementing the cascade by hand.
IsOverridden distinguishes "the player chose this colour" from "no config
entry exists". Without it a fresh install reads zeros and repaints the entire UI
transparent-black, which is what an unguarded TryGetByte returns when the key is
missing.
Constructors
UITKTheme(Configuration)
Builds a theme by parsing every colour entry from configuration once.
public UITKTheme(Configuration configuration)
Parameters
configurationConfigurationConfiguration to read from. May be null.
Fields
Background
General background color.
public readonly Color Background
Field Value
- Color
ColorNames
Configuration key prefixes, in the order FishMMO.Client.UITKTheme.present stores them.
public static readonly string[] ColorNames
Field Value
- string[]
Crosshair
Crosshair color.
public readonly Color Crosshair
Field Value
- Color
Health
Health bar color.
public readonly Color Health
Field Value
- Color
Highlight
Highlight color for hovered/focused UI elements.
public readonly Color Highlight
Field Value
- Color
IsOverridden
True when at least one colour was actually present in configuration.
public readonly bool IsOverridden
Field Value
Remarks
A theme with nothing overridden is applied as a no-op, leaving every panel on the values authored in FishMMO-Theme.uss.
Mana
Mana bar color.
public readonly Color Mana
Field Value
- Color
Primary
Primary UI element color (e.g., backgrounds, normal states).
public readonly Color Primary
Field Value
- Color
Secondary
Secondary UI element color (e.g., pressed/selected states).
public readonly Color Secondary
Field Value
- Color
Stamina
Stamina bar color.
public readonly Color Stamina
Field Value
- Color
Text
Default text color.
public readonly Color Text
Field Value
- Color
TooltipLabel
Tooltip label/description color.
public readonly Color TooltipLabel
Field Value
- Color
Version
The current skin's version. Absent or lower means the surface colours in the file belong to a skin this one shares no palette with.
public const int Version = 1
Field Value
VersionKey
Configuration key marking which skin last wrote the colour set.
public const string VersionKey = "UIThemeVersion"
Field Value
Methods
Clear(Configuration, string)
Removes a colour override from configuration, returning it to the stylesheet default.
public static void Clear(Configuration configuration, string name)
Parameters
configurationConfigurationConfiguration to write to.
namestringOne of ColorNames.
Remarks
The keys are removed rather than emptied. Both read back as "not overridden" —
Parse(Configuration, int, out bool) detects absence by TryGetByte failing, and an empty value
fails to parse just as a missing key does — but only one of them leaves the file
clean. Emptying wrote four dead lines per colour, so a player who reset their theme,
or loaded a shared profile that sets no colours, ended up with forty entries in
Configuration.cfg that exist only to say nothing.
HasOverride(int)
Whether the colour at the given index was present in configuration.
public bool HasOverride(int index)
Parameters
indexintIndex into ColorNames.
Returns
- bool
True when the player has set this colour.
HasOverride(string)
Whether the named colour was present in configuration.
public bool HasOverride(string name)
Parameters
namestringOne of ColorNames.
Returns
- bool
True when the player has set this colour.
Write(Configuration, string, Color)
Writes a colour to configuration in the {name}ColorR/G/B/A format.
public static void Write(Configuration configuration, string name, Color color)
Parameters
configurationConfigurationConfiguration to write to.
namestringOne of ColorNames.
colorColorThe colour to store.