feat(gamebook): library tile picker on boot #38

Merged
electron merged 1 commits from feat/gamebook-library into main 2026-06-19 13:24:47 +00:00
Owner

Two-mode gamebook (LIBRARY/STORY): boots into a tile grid from /sdcard/gamebook/library.json, picks a book, plays it, returns on end. Hardware-validated.

Two-mode gamebook (LIBRARY/STORY): boots into a tile grid from /sdcard/gamebook/library.json, picks a book, plays it, returns on end. Hardware-validated.
electron added 1 commit 2026-06-19 13:24:42 +00:00
feat(gamebook): library tile picker on boot
CI / platformio (pull_request) Failing after 3m56s
CI / platformio (push) Failing after 9m50s
a70963f64a
Context:
The gamebook played a single hard-coded book. We want the master to
boot into a library of several stories, shown as tiles, and let the
player pick one with the pad.

Approach:
Turn the gamebook component into a two-mode machine (LIBRARY / STORY).
On boot it loads /sdcard/gamebook/library.json and shows the stories as
a tile grid; selecting one loads that book's <id>.json and plays it;
finishing a story returns to the library.

Changes:
- display_ui: new library view — a 2x3 grid of title tiles with the
  selected one highlighted (display_ui_library_show/hide); it wins the
  view selector while open.
- gamebook.c: LIBRARY/STORY modes; load library.json + per-book
  <id>.json from the SD; grid navigation (up/down +/-2, left/right
  +/-1, click opens); story ending click returns to the library.
- main.c: gamebook_init only installs the pad hook; gamebook_start()
  (which opens the library) is now called after the SD + media_manager
  are up, so the boot picker actually finds the SD pack.

Impact:
The Freenove boots straight into a story picker and runs any book from
the SD library, fully offline. Hardware-validated: boots into a
6-story library.
electron merged commit a70963f64a into main 2026-06-19 13:24:47 +00:00
Sign in to join this conversation.