Port the options screen
Checks / web (push) Canceled after 0s

OPTION in the start menu runs _Option with the ROM's labels and settings,
OptionsControl's cursor wrapping and each option's bit handling. The four
option bytes live in the script state and saves, defaulting to
DefaultOptions. The battle style now decides whether a trainer's next
Pokémon brings an offer to switch, and the menu account whether the start
menu describes its items; the other settings are kept for later.

Closes #24

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sébastien QUEROLandClaude Opus 5.5 committed 2026-10-02 10:47:11 +02:00
1 parent 47698565ab
commit c4cc0e756c
19 files changed
+732 -21

No files matched your search

+37
View File
@@ -929,3 +929,40 @@ physical-device run.
Next: the options screen (board #24), then the Fly map and Teleport/Dig
warps.
The trainer card increment was committed as `4769856` (`Closes #23`; the
hook moved the card to Fait). Not pushed.
## Options: 2026-10-01
Continued in the same session with board card #24.
- `src/game/scripts/options.ts` (`OptionsMenu`): OPTION in the start menu
runs `_Option` on `state.options` (the start menu's draft) and returns to
the start menu. `options` effect answered with buttons; Start/B leave,
A on CANCEL leaves; `OptionsControl` wrapping; each option routine ported
from its bits (text speed's `.Save` keeps only the high nybble, so bit 3
is lost and bit 4 kept). Labels from `StringOptions` (read with a longer
`readString` limit), settings from the routines' strings.
- `GameOptions` = `wOptions`, `wTextboxFrame`, `wGBPrinterBrightness`,
`wOptions2`; `defaultOptions()` is `DefaultOptions`. In `ScriptState` and
saves (migrated by absence; frame above 7 refused).
- Consumers: `Battle` takes `shift` (from `BATTLE_SHIFT`) and
`CheckWhetherToAskSwitch` honours it; `StartMenu` drops descriptions
without `MENU_ACCOUNT`. Text speed, battle scene, sound, print and frame
are stored only.
- New `OPTIONS` profile table and OW option constants, verified by
`check:reference` (decimal literals: the checker skips `0b` values, which
a deliberately wrong `TEXT_DELAY_MED` confirmed).
- UI: `#options` panel, labels in a fixed column; checked at desktop and
390px widths.
Checks: 413 unit tests with the local ROM (134 passed, 279 skipped without
it; new `tests/options.test.ts` and a Set-mode test in
`tests/battle-switch.test.ts`); 119 Chromium/WebKit browser tests passed,
19 skipped intentionally (a new options flow in both browsers); native and
reference builds; reference, vendor and release checks; `git diff --check`.
No emulator comparison; no CI or physical-device run.
Next: the Fly map and Teleport/Dig/Escape Rope warps (board #25), which
need script commands after a warp; then Headbutt and Rock Smash (#26).