FArcUITheme
A game-UI theme: the named colours, fonts and metrics a .ui resolves its tokens against. Serialized as MDF under the engine's existing .theme extension, so it browses, cooks and validates like every other text asset. A screen names its theme; without one the host's project theme applies, and without that the built-in default theme — which carries exactly the colours the factory used to hardcode, so nothing an older asset authored moves.
- Module
- ArcUI
- Header
#include "ArcUI/FArcUITheme.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
std::string | Name | Default "Default". |
std::vector<FArcUIThemeColor> | Colors | |
std::vector<FArcUIThemeFont> | Fonts | |
std::vector<FArcUIThemeMetric> | Metrics |
Public functions
| Returns | Name | Description |
|---|---|---|
const FArcUIThemeColor* | FindColor | |
const FArcUIThemeFont* | FindFont | |
const FArcUIThemeMetric* | FindMetric | |
bool | ResolveColor | |
bool | ResolveMetric | |
void | SetColor | |
std::vector<std::string> | ColorTokens | |
std::string | SerializeToMDF | |
bool | ParseFromMDF | |
bool | LoadFromFile | |
bool | SaveToFile | |
std::string | NormalizeToken | "token/accent", "Content/UI/Game.theme.accent" and "AccentColor" all name the same token: the path prefix is dropped, the rest lowercased and run through the legacy aliases the hardcoded map understood. |
FArcUITheme | MakeDefault | |
Vec4 | HighContrastColor | What a colour token reads as under the player's High Contrast UI: surfaces go black (at least 92% opaque), text goes white, and every other colour keeps its hue at full brightness and at least half the luminance of white, so it reads against the black surface. |
const FArcUITheme& | Default |
Function details
FindColor
const FArcUIThemeColor* FindColor(const std::string& token) constFindFont
const FArcUIThemeFont* FindFont(const std::string& name) constFindMetric
const FArcUIThemeMetric* FindMetric(const std::string& name) constResolveColor
bool ResolveColor(const std::string& token, Vec4& out) constResolveMetric
bool ResolveMetric(const std::string& name, float& out) constSetColor
void SetColor(const std::string& token, const Vec4& value)ColorTokens
std::vector<std::string> ColorTokens() constSerializeToMDF
std::string SerializeToMDF() constParseFromMDF
bool ParseFromMDF(const std::string& text, std::string* outError = nullptr)LoadFromFile
bool LoadFromFile(const std::string& path, std::string* outError = nullptr)SaveToFile
bool SaveToFile(const std::string& path) constNormalizeToken
static std::string NormalizeToken(const std::string& token)"token/accent", "Content/UI/Game.theme.accent" and "AccentColor" all name the same token: the path prefix is dropped, the rest lowercased and run through the legacy aliases the hardcoded map understood.
MakeDefault
static FArcUITheme MakeDefault()HighContrastColor
static Vec4 HighContrastColor(const std::string& normalizedToken, const Vec4& value)What a colour token reads as under the player's High Contrast UI: surfaces go black (at least 92% opaque), text goes white, and every other colour keeps its hue at full brightness and at least half the luminance of white, so it reads against the black surface. Tokens only — a literal colour authored in a .ui is the author's to choose.
Default
static const FArcUITheme& Default()