Show short game pauses through the front-end - #129
Conversation
Self-reviewReviewed the full diff against this repo's conventions — front-end parity, the schema/reader-writer contract, test coverage on new public methods, and doc drift. No blocking findings. One weak test was found and fixed in this branch before posting (5f8cb4a). Notes below, in Fixed during review
Verified, no change needed
Contract checks
|
Adds a showBusy primitive to BaseUserInterface and routes the "Fishing..." and drinking pauses through it, so all three front-ends show them. Also corrects Old Tom's stale description of the dice payout and rejects sub-$1 gambling bets up front. Closes #125 Closes #126 Closes #127 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The previous version's clock stub exited the wait loop before any event was read, so it never showed a keypress is ignored - only that the prompt was left alone. It now runs two frames, with the keypress in the first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
5f8cb4a to
f56c83e
Compare
Rebase note (scope reduced)#128 landed on Two incidental changes came out of the rebase, both worth calling out:
Suite re-run after the rebase: 388 passed, coverage 95%. |
Summary
Adds a
showBusy(message, seconds)primitive toBaseUserInterfaceand routes the game's two short pauses through it.Docks.fishandTavern.getDrunkused toprint()their flavour text andtime.sleep()directly, bypassing the UI contract. On the console that read fine; on the other two front-ends the text went to the terminal and the player just saw the previous screen frozen for 1-3 seconds. (getDrunkalso calledlotsOfSpace()/divider()first, which on pygame fills the surface without ever flipping the display, and on web are documented no-ops — so nothing was drawn either.)Implemented in all three front-ends:
busyscreen the client renders, and consumes no input; the next screen supersedes it.README.md's "implementBaseUserInterface+ aUIType+ a factory branch" instruction still holds as written.Closes #125
Test plan
python3 -m compileall -q src testsSDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy python3 -m pytest --verbose -vv --cov=src --cov-report=term-missing --cov-report=xml:cov.xml— 388 passed, coverage 95%test_userInterface.py), pygame (test_pygameUserInterface.py— the message is drawn, a keypress neither ends the pause nor rewrites the prompt, and an over-wide message wraps), web (test_webUserInterface.py— thebusyscreen is presented, no input is consumed, and the client page has a matching render branch), and the inherited default (test_baseUserInterface.py).test_docks.py/test_tavern.pystubshowBusyinstead of patchingprint/sys.stdout.flush/time.sleep, and assert the pause is announced through the UI.Player/Stats/TimeServicefield changed, soschemas/*.jsonand the*JsonReaderWriters are correctly untouched;README.md/PLANNING.mddescribe nothing that changed here.This PR description was drafted during a Gardener session (Stephenson-Software/gardener).