Validate and package a theme
Check a theme loaded and draws on every screen, then ship ui/theme.toml, ui/screens.toml and their assets in the game package.
Before you ship a theme, confirm it loaded, check every screen and state by eye, and test the installed package. Do this after each round of changes and before every release of your game.
The worked example
- Begin with a complete bundled base and change one material family at a time.
- Start AEX with your game active. Check the loaded theme name and diagnostics; a good-looking fallback is not proof that your file loaded.
- Check menus, lobby and all settings, map selection, loading, HUD, pause, Help, chat, scoreboard and game-end results. Review victory and defeat.
- Check keyboard focus, disabled states, contrast, low resolution and scaling. Target at least 4.5:1 for ordinary text and 3:1 for meaningful indicators.
- Test with only the assets you intend to ship. A missing/unreadable skin image or slices that leave no centre logs a warning and leaves the procedural face visible. Other named pictures can appear blank even when token validation passes; check that the intended artwork actually draws.
- Include the custom material file
ui/theme.tomlwhen used, an authoredui/screens.tomlwhen used, and their dependencies in the game/mod package. Test the installed package and a fresh launch, not just the loose source folder.
For step 2, aex.log names the file and theme that loaded:
UiTheme: loaded <N> fonts, <N> colors, <N> sizes, <N> surfaces from vfs:ui/theme.toml (My Game)
What the loader checks
The loader validates supported tables, values, inherited completeness, colour
references, surface-base chains and fonts. An invalid native theme is rejected
as a whole; AEX tries a legacy ui/theme.tdf if present, then the player's/default
bundled themes. A bundled theme also has an embedded fallback. Validation is not
a substitute for visual checks, image checks or testing the packaged game.
Formats and reloading
Native theme loading is preferred; existing TDF themes still work. Keep only the format you intend to ship unless a legacy fallback is deliberate. There is no live reload: restart to apply edits. A signed whole-game package and an authored theme are separate concerns; a theme file is not a signed release by itself.
What goes wrong
A theme with a missing required entry or an invalid value is rejected, and the log lists the entries:
UiTheme: theme '<name>' (vfs:ui/theme.toml) is incomplete, keeping <current theme>: <N> missing, <N> invalid; missing: <entries>; invalid: <entries>
AEX then tries the next candidate:
UiTheme: the mounted ui/theme.toml is incomplete; trying the next theme candidate
UiTheme: no complete mounted theme; using the bundled theme
If the player's saved bundled theme is not in this build, AEX uses the default:
UiTheme: no bundled theme '<id>'; using the default
What to plan next
Read the coverage and gap list before promising bespoke victory screens, animated controls, interface audio or a video introduction. For AI behavior, use AI profiles; for units, use the unit schema. Those capabilities remain separate from presentation.