Phase 4 remainder: crafting screens, slider, config options

Game-file footprint unchanged: still one line in main.lua.

The slider turned out to be genuinely generic: modules/slider.lua is a factory,
so one wrapper on it narrates all four users -- craft, refine, trade and
ingame_wait (the wait-N-turns screen). Same leverage as the console.print and
inventoryCursorPopup patches.

The options screens do NOT share it, though: config_menu changes values through
config.increase/config.decrease, so it needed its own descriptor. It reports tab,
option name and value, and its focus key includes the value so left/right
re-announce even though the focused option has not moved.

states/_itemgrid.lua is now shared by inventory, craft, refine and trade, all of
which build a views/inventoryWindow. It stays silent while
confirmationWindowEnabled is set so the slider owns speech during quantity
selection instead of the two fighting.

testbed gains walkTo(), which navigates using the game's own pathfinder rather
than hardcoded direction sequences -- those drift as soon as anything moves the
player. The config test only adjusts a value when the focused option is
demonstrably safe, and puts it straight back.

The slider patch is applied and confirmed by the self-test but not exercised
live: ingame_wait is unreachable in the prologue because tutorial_bed overrides
bed's tryInteractFunction with an empty function by design, and the crafting
screens need an alchemy table and real items. Recorded as a NOTE rather than a
failing check, since it is a property of the game and not of the mod.

25/25 testbed checks, history unit tests passing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Accessibility Mod
2026-08-01 22:12:56 +02:00
co-authored by Claude Opus 5
parent d8bec6a3a8
commit 50b226620e
10 changed files with 451 additions and 67 deletions
+34 -6
View File
@@ -7,7 +7,7 @@ Phase 4 mostly done. Phase 5 (status, popups) next.**
**Game is playable start-to-finish by ear** from main menu through the intro
conversation into gameplay, plus journal, character, actions and inventory —
verified by the testbed, **21/21 checks**.
verified by the testbed, **25/25 checks**.
### Run the testbed (do this after any change)
```
@@ -358,12 +358,40 @@ slot or empty tab it said nothing — you couldn't tell whether the cursor moved
The `inventory` descriptor reports item-or-empty plus slot and tab; letting both
speak would double up on every item.
### Done — Phase 4 remainder: crafting screens, slider, config
**21 states have descriptors; 4 patches applied.** 25/25 testbed checks.
**The slider is genuinely generic** — `modules/slider.lua` is a *factory*
(`newSlider(params)`), and one wrapper on it narrates **all four** users:
`craft`, `refine`, `trade` and `ingame_wait` (the wait-N-turns screen). Same
leverage as the `console.print` and `inventoryCursorPopup` patches.
⚠ **But the options screens do NOT use it.** `config_menu` changes values through
`config.increase` / `config.decrease`, so it needed its own descriptor. It
reports tab + option name + value:
`Allow hitting yourself, No, 3 of 11` → right → `…, Yes, …`. The focus key
includes the value, so left/right re-announce even though focus hasn't moved.
`accessibility/states/_itemgrid.lua` is now shared by `inventory`, `craft`,
`refine` and `trade` — all four build a `views/inventoryWindow`. It stays silent
while `confirmationWindowEnabled` is set, so the slider owns speech during
quantity selection rather than the two fighting.
**Ordering note:** `patches/slider.lua` replaces `package.loaded["modules.slider"]`,
so it only affects requires that happen *after* it. Safe because states load
lazily and `applyPatches()` runs before the self-test (the one thing that loads
state files early).
⚠ **Slider not exercised live.** `ingame_wait` is unreachable in the prologue —
`tutorial_bed = { parent = "bed", tryInteractFunction = function() end }`, i.e.
the tutorial bed does nothing *by design*. `craft`/`refine`/`trade` need an
alchemy table and real items. The patch is confirmed *applied* by the self-test;
the testbed has the walk-to-bed machinery ready (`walkTo`, tracker lookup) for
when a real bed is reachable.
### Known gaps (next up)
- **Phase 4 remainder**: `research`, `config_menu`, `keybindings_menu` have no
descriptors. `craft` / `refine` / `trade` are covered only by the
`inventoryCursorPopup` patch — so, like inventory was, they will be silent on
empty slots and say nothing about the quantity **slider** in the confirmation
window (`modules/slider.lua`, Left/Right adjusts, Shift for ×5).
- **Phase 4 remainder**: `research` and `keybindings_menu` have no descriptors.
- **Phase 5**: player status key (HP, statuses, current action), popup
announcements (`popupStack.add`), damage alerts
(`ingame.checkInterruptions`), mod settings.