1.5 KiB
UI Generation Structure
Current Rule
Do not hand-edit ui/DefaultGroup.ui for SlayDeck UI changes. It is generated
by tools/deck/gen-slaydeck.mjs.
The .ui file is expected to stay large because MapleStory Worlds stores UI as
one JSON entity list. The maintainable source is the generator, not the output.
Generated Sections
tools/deck/gen-slaydeck.mjs centralizes generated UI roots in
GENERATED_UI_SECTIONS:
DeckHudDeckInspectHudDeckAllHudCombatHudRewardHudMapHudShopHudRestHudMainMenuCharacterSelectHud
When the generator runs, existing entities under those roots are removed and
emitted again. Stock mobile controls are handled separately by
DISABLED_STOCK_CONTROLS.
How To Change UI
- Edit the relevant section in
tools/deck/gen-slaydeck.mjs. - Add new top-level HUD roots to
GENERATED_UI_SECTIONS. - Emit section entities with
emit('SectionName', entities). - Run
node tools/deck/gen-slaydeck.mjs. - Verify JSON parsing for generated files.
emit() validates that a section only emits paths under its own root. This
keeps accidental cross-section UI changes from silently landing in
DefaultGroup.ui.
Next Refactor Target
The next useful split is to move each large section builder into separate files, for example:
tools/deck/ui/combat-hud.mjstools/deck/ui/shop-hud.mjstools/deck/ui/map-hud.mjstools/deck/ui/menu-hud.mjs
Keep shared helpers like entity, transform, sprite, button, and text
in one shared UI helper module.