Show the score in the graphical UI, and scope format.sh to skip vendored code - #125
Conversation
… pass black now reads its exclusion from a new pyproject.toml [tool.black] section and autoflake is given --exclude lib, so neither rewrites the vendored graphik/py_env_lib copies under src/lib. The eight non-vendored files that had drifted out of black's style are reformatted here in one pass, so subsequent diffs stay scoped to their actual change. Closes #120 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The score was read only by the end-of-run console summary, the save record and the text UI's stats block, so a player in the default graphical UI had no way to see it while playing - and the score-multiplier power-up's "(x2)" annotation had no line to attach to there. drawHud now leads with the score alongside the currency it already drew. Whether and how a multiplier is annotated moves into scoring.formatScoreLabel, which the text renderer reads too, so the rule lives in one place rather than being restated per UI. Closes #124 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
52e2341 to
4e8cfa6
Compare
Matches tests/ui/test_banner.py's drawText stub, so the assertion is about the string drawn rather than about drawText's exact remaining parameters. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Self-reviewThe full diff was read against this repository's conventions. Nothing blocking was found. Three judgment calls are worth a reviewer's attention, and one finding was applied before this comment was posted. Applied
For a reviewer to confirm
Checked and clean
This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). |
Summary
src/libnow lives in a newpyproject.toml[tool.black]section, andautoflakeis given--exclude lib, so re-vendoring an upstream copy of graphik or py_env_lib is no longer turned into a merge conflict. The eight non-vendored files that had drifted out of black's style are brought back into line in one pass, so subsequent diffs stay scoped to their actual change. Landing that first is also why the second commit's diff is readable.drawHud()now leads with the score alongside the currency readout it already drew; previously the score was reachable only through the text UI, the end-of-run console summary and the save record, which left the score-multiplier annotation with no line to attach to in the default UI. The score shares the first HUD line with the currency because graphik centres each string on the x it is handed, so two centred strings on one row would overlap.(x2)is appended moves intoscoring.formatScoreLabel, which both the graphical HUD andTextRenderer.renderStatsread, so the two UIs cannot restate it differently — the drift that PRs Add text-based UI option for terminal gameplay #92, Add text-based UI option with clean architecture, comprehensive testing, CI/CD verification, and performance optimizations #95 and Add cross-run progression: obituaries, cosmetics, currency/shop, naming/lore, ascension #99 were each about.formatScoreLabelis a pure function alongside the scoring rules the renderers are already handed plain numbers from, so no new gameplay-to-UI coupling is introduced.(x2)annotation is no longer text-UI only.Not included: #122
Issue #122 was investigated and is not reproducible as described; it has been left open with the evidence posted as a comment there, because deciding what should happen instead is a design call rather than a bug fix. In short:
checkForLevelProgressAndReinitialize()is only ever reached fromrestartRun()and the collision branch ofmoveEntity(), both of which callrecordCurrentRun()first, so a run is always exactly one level and the score is never discarded mid-run.Test plan
python3 -m pytest— 223 passed (217 onmain)python3 -m compileall src— cleanpython3 -m black --check src tests— clean, andsrc/libis left untouchedformatScoreLabelat a neutral, doubled and fractional multiplier, and the graphical HUD's score line both with and without a multiplier runninghandleKeyDownEventand the--text-uiargparse flagCloses #120
Closes #124
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).