Repository navigation
Feature Template Navigation Menu
Replaces the per-row "type menu" panels with a wider template navigation menu anchored at every variant row. One panel now exposes the whole editor surface: category buttons across the top, every type in the current category as a side-by-side strip, the row's own variant list expanded in place, and sub-variants rendered inline next to every variant that has children. Wherever an author walks in the editor world, the full nav is one row away.
+-----------------------------------------------------+
| Carriages | Contents | Tracks | ← category bar
+--------------+--------+--------+--------+-----------+
| Carriages | Floor | Walls | Roof | Doors | ← type-tab strip
+--------------+--------+--------+--------+-----------+
| standard ×20 | [child_a] [child_b] |
| windowed ×20 | | ← expanded variant
| flatbed ×1 | | list on the left,
| + New | | sub-variant cells
+--------------+--------------------------------------+ on the right
-
Category bar. Carriages | Contents | Tracks across the top. The
active category is tinted green. Clicking a button runs
/dt editor <id>(same teardown + teleport as typing the command). ARCHITECTURE is filtered out until the category has stamped plots. - Type-tab strip. Every type within the active category gets a tab. The tab matching the row the player is standing in is expanded (yellow, leftmost); every other tab collapses to just its type-name header in dim grey. Clicking a collapsed tab teleports to that type's first variant.
-
Expanded variant list. Same content as the legacy single-column
type menu: variant name (teleport on click), weight
×Ncell (+1/ shift-1), provenance tints (blue = user-authored, orange = imported), green active-row tint for the variant the player is physically standing in,+ Newfooter. -
Inline sub-variants. Every variant carries its own children list
(server populates from
CarriageContentsGroupStorefor CONTENTS variants). The renderer draws each child as a clickable cell to the right of its parent's row — not just for the active variant. Provenance tints and the active-row green carry through onto the cell.
The menu sizes itself in two steps:
-
Base width = tabs + the reserved minimum sub-variant area
(
SUB_VARIANT_AREA_MIN_W). Panel reads as having "room for" sub-variants even when none exist. - Needed width = tabs + the widest single sub-variant row (no wrap).
-
Actual width =
min(needed, base × 2.25). (NAV_WIDTH_GROWTH_CAP.)
When a variant's sub-variants don't fit at the capped width, the overflow wraps to a second line below the variant row. Subsequent variants shift down by the wrap count. Hard cap at two lines per variant — anything past that is truncated rather than expanding the panel vertically.
Each anchor renders the menu whose typeName matches its own row's
type, and the expanded tab is always at the leftmost position in the
strip. So at the Floor row, the panel reads
Floor | Carriages | Walls | Roof | Doors; at the Doors row,
Doors | Carriages | Floor | Walls | Roof. The variant list lives in
the same screen position regardless of which row the player is at —
players can find what they're editing without scanning across.
The floating companion panel that anchors next to the per-plot label (see Editor floating panels) and lists the active variant's children with the sub-variant weight editor from v0.134.0 (PR #175) is untouched. Same code path, same behaviour — the new nav menu adds the inline cells alongside, it doesn't replace the companion.
EditorTypeMenusPacket.Menu gained three fields (populated only on
row-start nav panels):
-
activeCategoryId— drives the green tint on the category bar. -
categoryBar— orderedList<CategoryButton>(id + display name). -
typeStrip— orderedList<TypeTab>(type name + first-variant teleport target).
Variant gained a recursive subVariants list — server populates from
the group store for CONTENTS variants, empty for everything else.
Legacy convenience constructors are preserved so the sub-variants
companion (built by VariantOverlayRenderer) and any other existing
call site continue to compile and serialise unchanged. Server and client
must ship as a matched pair (standard for this mod).
| Layer | File |
|---|---|
| Wire format | src/main/java/games/brennan/dungeontrain/net/EditorTypeMenusPacket.java |
| Server builder | src/main/java/games/brennan/dungeontrain/editor/EditorTypeMenus.java |
| Client renderer | src/main/java/games/brennan/dungeontrain/client/menu/plot/EditorTypeMenuRenderer.java |
| Click dispatch | src/main/java/games/brennan/dungeontrain/client/menu/plot/EditorTypeMenuInputHandler.java |