From 27b58a5b715c83baa497acc59ce6ce3ffcebff1e Mon Sep 17 00:00:00 2001 From: funman300 Date: Tue, 12 May 2026 15:29:33 -0700 Subject: [PATCH] fix(engine): pause game timer while onboarding modal is visible tick_elapsed_time already stopped the clock for PausedResource and HomeScreen, but not for the first-run onboarding modal. A new player reading the three welcome slides would see their first-game time inflated by however long they spent on the tutorial. Added OnboardingScreen to the early-return guard using the same pattern as HomeScreen. Co-Authored-By: Claude Sonnet 4.6 --- solitaire_engine/src/game_plugin.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/solitaire_engine/src/game_plugin.rs b/solitaire_engine/src/game_plugin.rs index 04aaa56..4784325 100644 --- a/solitaire_engine/src/game_plugin.rs +++ b/solitaire_engine/src/game_plugin.rs @@ -252,20 +252,25 @@ pub fn advance_elapsed( } /// Increment `GameState.elapsed_seconds` once per real-world second while -/// 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. +/// the game is in progress (not won), not paused, and no blocking modal +/// (Home picker or first-run onboarding) is covering the board. Stops +/// counting on win so the final time reflects how long the player took; +/// stops while the pause overlay is open; stops while Home is up so the +/// timer doesn't tick before the player commits to a deal; stops while +/// the onboarding modal is visible so a new player's first-game time +/// isn't inflated by reading the tutorial. fn tick_elapsed_time( time: Res