Skip to content

Route the save-file manager through the UI (closes #42)#89

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/pygame-save-menu
Jun 13, 2026
Merged

Route the save-file manager through the UI (closes #42)#89
dmccoystephenson merged 1 commit into
mainfrom
feature/pygame-save-menu

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Why

This is the last piece of #42 (tracked as #88). The pre-game save-slot manager used bare input()/print(), so a pygame player still had to use the console to pick or delete a save.

What changed

  • FishE.__init__ now builds the UI early (with default new-game state) before the save-file manager runs, then loads the chosen slot over those defaults and points the UI at the loaded state. (This also simplified the load block — defaults are created once instead of via else branches.)
  • _selectSaveFile / _deleteSaveFile present save slots and actions (Load / Create New / Delete / Quit; and the delete confirmation) as numbered showOptions choices, and use showDialogue for messages — so the whole flow renders and reads input through the active front-end.

grep confirms no bare input() remains anywhere in the game; every input goes through the UI. Together with #87 (in-play input), #42 is fully resolved.

Test plan

  • python3 -m compileall -q src clean
  • SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest — 190 passed
  • New test_fishE cases for the now-testable menu: new-game selects the next slot, loading selects the chosen slot, delete confirmed vs cancelled. Existing test_initialization still passes with the construction reorder.

Closes #42
Closes #88

🤖 Generated with Claude Code

The pre-game save-slot manager was the last place using bare input()/print(),
which only worked in the console. It now renders and reads through the active
front-end:

- The UI is built early in __init__ (with default new-game state) so the manager
  can use it; the chosen save is loaded over the defaults afterward and the UI is
  pointed at the loaded state.
- _selectSaveFile / _deleteSaveFile present slots and actions as numbered
  showOptions choices, and use showDialogue for confirmations — so they work in
  pygame (and any future front-end), not just the console.

No bare input() remains anywhere in the game; every input goes through the UI.

Closes #42
Closes #88

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@dmccoystephenson dmccoystephenson left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review:

  • Scope: PASS — fishE init reorder + save-menu rewrite + tests.
  • Issue: PASS — no bare input() remains anywhere; save menu now renders/reads via showOptions/showDialogue, so pygame needs no console. Closes #42/#88.
  • Behavior: PASS — console still works (slots/actions as numbered options); load-if-exists logic preserved (defaults created once instead of else-branches).
  • Tests: PASS — 190; new menu tests (new/load/delete-confirmed/cancelled); test_initialization validates the construction reorder.
  • Persistence safety: load/save methods, saveFileManager, schemas, and reader/writers untouched.
  • CI: PASS.

@dmccoystephenson dmccoystephenson merged commit 00e3036 into main Jun 13, 2026
1 check passed
@dmccoystephenson dmccoystephenson deleted the feature/pygame-save-menu branch June 13, 2026 13:40
dmccoystephenson added a commit that referenced this pull request Jun 13, 2026
The README said the save-file manager shows each save's "Last Modified" time,
but since the manager was routed through the UI (#89) each slot is presented as
a compact menu option labelled "Load Slot N (Day X, $Y, Z fish)" — it no longer
displays a last-modified timestamp. A reader comparing the docs to the actual
screen would be misled.

Updates the Multiple Save Files section to match what the manager actually shows
(Day, Money, Fish count) and reflects that slots are chosen as menu options.
The rest of the docs were swept against source as part of this pass: README
features, the branching/Contributing section, and all four schemas (verified
in sync with their reader/writers) are accurate.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Route the pre-game save-slot manager through the UI (last console-only input) Support all needed input through pygame UI

1 participant