Build menu layouts
Classic TA shows a builder's pages as made; Expanded 2x4, 2x5 and 2x6 reflow them. A mod sets the default with build_menu.
The layout decides how a builder's pages are shown: as they are made, or reflowed into taller pages. It is the player's view only; the game itself never sees it. A mod chooses the layout its players start with.
The worked example
In the mod's mod.toml:
id = "my-mod"
name = "My Mod"
version = "0.1.0"
aex_version = "0.2"
build_menu = "2x6"
Players of the mod start with 2-column, 6-row pages. Each player can still pick another layout.
The layouts
| Option (Options > Interface > Build Menu) | build_menu |
Shows |
|---|---|---|
| Classic TA | "classic" |
The builder's pages as they are made: a TA mod's GUI pages, or AEX's 2x3 grid for a standalone game's menus |
| Expanded 2×4 | "2x4" |
Pages of 2 columns and 4 rows |
| Expanded 2×5 | "2x5" |
Pages of 2 columns and 5 rows |
| Expanded 2×6 | "2x6" |
Pages of 2 columns and 6 rows |
| Mod Default | (none) | Clears the player's choice |
The layout in use is the player's choice; without one, the active mod's
build_menu; without that, Classic TA. A value other than the four above is
ignored with a warning when the mod loads.
How the expanded layouts fill
- The buttons keep their order: page by page, then button by button.
- Gaps between buttons close up, and a unit the menu hides leaves no gap.
- A builder whose pages already have the chosen shape keeps them exactly,
gaps and large buttons included. A mod that draws 2x6 GUI pages, as TA
Escalation does, and sets
build_menu = "2x6"is shown exactly as drawn. - Stock TA's 2x3 pages always reflow.
- When the window is too short for the chosen rows, the menu shows the tallest layout that fits.
TA and AEX
Stock TA has only its 2x3 pages; Classic TA is that view. The expanded layouts are AEX's. They change no unit, cost or rule, so players with different layouts play in the same match.
The build keys of a unit are the same in every layout and on every page.
What goes wrong
- The mod's layout does not apply: the player has picked a layout. Mod Default clears that choice.
- A large button splits or moves: the chosen layout is not the shape the page was drawn in, so it reflows. Choose the shape the pages are drawn in.
- The layout is shown in the mod's details: Options > Install, the mod's
details page, under Settings, lists the
build_menuthe mod sets.