P7.2: goal HUD + win/lose banner + restart button (sx, iOS sim)
Extend the HUD to show the per-level goal (SCORE x / target) alongside
moves. When the model's level_status (P7.1) is won/lost, draw a centered
overlay banner ("YOU WIN!" / "OUT OF MOVES") with a "PLAY AGAIN" restart
button over the dimmed board; the banner appears once any winning/losing
cascade animation settles. Status is read from the model, never recomputed
in the view.
A finished level freezes board-cell input; only the restart button is live.
Its rect is derived from the shared BoardLayout grid (new BannerLayout), so
the hit-test lands exactly on the drawn button. A tap reseeds the same
starting level through board.restart and clears the transient view layers,
returning to a clean in_progress board.
Banner is text + rects only (honours colour/alpha; no draw-time image tint,
issue 0002). New env capture hooks (M3TE_TARGET / M3TE_MOVE_LIMIT /
M3TE_RESTART) force a terminal status / restart for deterministic goldens.
Tests: tests/banner_layout.sx locks the restart button rect <-> hit-test
round-trip headlessly. Goldens p7_win / p7_lose / p7_restart captured on the
iOS simulator.
This commit is contained in:
1
tests/expected/banner_layout.exit
Normal file
1
tests/expected/banner_layout.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
9
tests/expected/banner_layout.stdout
Normal file
9
tests/expected/banner_layout.stdout
Normal file
@@ -0,0 +1,9 @@
|
||||
grid (100,0,600,600)
|
||||
panel (148,168,503,264)
|
||||
title (148,215,503,79)
|
||||
button (248,326,302,63)
|
||||
button mid_x 400 grid mid_x 400
|
||||
button corners inside panel: 4/4
|
||||
button center hit: true
|
||||
off-button taps that hit the button: 0
|
||||
ok: restart button hit-test matches the drawn banner
|
||||
Reference in New Issue
Block a user