From c497c3193c17471eedc8ca2d99a667629518df50 Mon Sep 17 00:00:00 2001 From: funman300 Date: Wed, 6 May 2026 17:29:42 +0000 Subject: [PATCH] fix(engine): freeze game timers while the Home picker is up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The HUD's elapsed-time counter ticked from the moment the default Classic deal landed at startup, even though the auto-show Home picker was still up — so the player saw "0:11" before they had chosen a mode. Time Attack had the same issue when M was pressed mid-session: the 10-minute countdown burned while the player browsed modes. `tick_elapsed_time` and `advance_time_attack` now also gate on the absence of `HomeScreen`, mirroring their existing `PausedResource` check. The Home modal already covers input via its scrim, so this purely freezes the timer without coupling to the pause-overlay ownership of `PausedResource`. Co-Authored-By: Claude Opus 4.7 (1M context) --- solitaire_engine/src/game_plugin.rs | 12 ++++++++---- solitaire_engine/src/time_attack_plugin.rs | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/solitaire_engine/src/game_plugin.rs b/solitaire_engine/src/game_plugin.rs index 514472d..d1c658f 100644 --- a/solitaire_engine/src/game_plugin.rs +++ b/solitaire_engine/src/game_plugin.rs @@ -252,16 +252,20 @@ pub fn advance_elapsed( } /// Increment `GameState.elapsed_seconds` once per real-world second while -/// the game is in progress (not won) and not paused. Stops counting on -/// win so the final time reflects how long the player took to solve the -/// deal; stops while the pause overlay is open. +/// the game is in progress (not won), not paused, and the launch / +/// mode-picker Home modal isn't covering the board. Stops counting on +/// win so the final time reflects how long the player took to solve +/// the deal; stops while the pause overlay is open; stops while Home +/// is up so the timer doesn't tick under the picker before the player +/// has actually committed to a deal. fn tick_elapsed_time( time: Res