From 20e5222148c5d32c9190c3cf7f17ce0d67bf06cd Mon Sep 17 00:00:00 2001 From: funman300 Date: Mon, 1 Jun 2026 15:26:07 -0700 Subject: [PATCH] fix(engine): send confirmed:true from game-over screen New Game handlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'No Moves Available' dialog's New Game button and keyboard shortcut were firing NewGameRequestEvent::default() (confirmed: false). When the player has made moves, handle_new_game sees needs_confirm = true, then hits the scrims.is_empty() guard — which is false because the GameOver- Screen itself is a ModalScrim — and silently returns without starting a new game or showing the confirm dialog. Fix: set confirmed: true in both handle_game_over_input (N/Escape key) and handle_game_over_button_input (click). The game is already stuck so the abandon-confirmation guard does not apply, as the doc comment on the button handler has always said. Co-Authored-By: Claude Sonnet 4.6 --- solitaire_engine/src/game_plugin.rs | 6 ++++-- solitaire_server/web/pkg/canvas_bg.wasm | Bin 29902807 -> 29902807 bytes 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/solitaire_engine/src/game_plugin.rs b/solitaire_engine/src/game_plugin.rs index e6e5b00..691d702 100644 --- a/solitaire_engine/src/game_plugin.rs +++ b/solitaire_engine/src/game_plugin.rs @@ -1190,7 +1190,8 @@ fn handle_game_over_input( }; if keys.just_pressed(KeyCode::KeyN) || keys.just_pressed(KeyCode::Escape) { - new_game.write(NewGameRequestEvent::default()); + // confirmed: true — the game is already stuck; no abandon-confirmation needed. + new_game.write(NewGameRequestEvent { confirmed: true, ..default() }); } else if keys.just_pressed(KeyCode::KeyU) { for entity in &screens { commands.entity(entity).despawn(); @@ -1217,7 +1218,8 @@ fn handle_game_over_button_input( return; } if new_game_buttons.iter().any(|i| *i == Interaction::Pressed) { - new_game.write(NewGameRequestEvent::default()); + // confirmed: true — the game is already stuck; no abandon-confirmation needed. + new_game.write(NewGameRequestEvent { confirmed: true, ..default() }); } else if undo_buttons.iter().any(|i| *i == Interaction::Pressed) { for entity in &screens { commands.entity(entity).despawn(); diff --git a/solitaire_server/web/pkg/canvas_bg.wasm b/solitaire_server/web/pkg/canvas_bg.wasm index 7a44519e93dc6126151debb01ea2f6e948ce7239..4b756f3c80fe319dbefe716259ff873a8ab6b37b 100644 GIT binary patch delta 1873 zcmXBSRalT&6op}a69c=u#YDyK?(XjH7Q2>WpxBroCU$pV$2eV1C)4S4&#ce6_}=I2 zeYv0WI5siMW4B0wQYp34D6P^dy+V~i8I?(y6{al8s%*-x9LlL&%B?)gt9;6@0xGCN zDy$+Zs$wdx5-O=uDy=dqt8kT5c~wwFRZ?X|sEVqpnj%$QHB?izR9kgaSM^k14b)JL z)L2c_RL#^}E!0x2)LL!SR_)YY9n?{s)LC8BRo&EGJ=9aZ)LVVjSN+sq12j;BG+0A4 zRKqk}BQ#Q@G+JXcR^v2Y6EsniG+9&5PEDH<7vHXDSlqdar}9LHr%ZLz+;lg?&2+O| zl$-75xVdhgo9`C5g>I2s?3TEtPHvf7?xNiax6-Y0t6hv+$!&I9 zT%6nLwz=(Yhui6PxplKKN9Y8dp$l|{ZqOZiKu_oey`c~Eg?`W<2EafV1cPA+425AZ z97e!M7zLwY42*?wFdinrM3@AVVG2xzX)qmTz)YA0Pyf|yUUOhB%!B!`02aa`SPV;G zDF~Lqa)^c%uo6}U$w^VGgA*4+YlMUZAt518k_T0d2_k~vSVC;In4o%Stb_Hi0XD)W*bG}B4z|KJ*bX~jC+vcFNPyjt2zy{J?1TMq01iSD z9D>7e1dhTnI1VS^B%FfNa0br8IXDj&;38at%Wws*!Zo-K$#4U1!Y#NBci=AEgZn{p KMC5}YDc651wk`_* delta 1873 zcmXBSRalT&6op}a6T75{tpUEE^o;uA*l%nZh>3q7P%O=*e!8Oo!m0F+{L;TZlzo0R=YU2#;tYnZk=22Hn@#0!EJJz zU839Kwz_R@yW8P*x?L{G?RIt%kGN1>aMx#?uNVRl3j|s?ykG%?z;!>p?k_b?H;*j z+_UaE_q=<-z35(YFS}RVtL`=T*uC!FaBsS|+}rLQ_pW=-z3)D7AG(iRs{7b|;y!h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