fix(engine): freeze game timers while the Home picker is up

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) <noreply@anthropic.com>
This commit is contained in:
funman300
2026-05-06 17:29:42 +00:00
parent 9aa0dd23b1
commit c497c3193c
2 changed files with 13 additions and 5 deletions
+5 -1
View File
@@ -171,11 +171,15 @@ fn advance_time_attack(
mut ended: MessageWriter<TimeAttackEndedEvent>,
paused: Option<Res<crate::pause_plugin::PausedResource>>,
path: Option<Res<TimeAttackSessionPath>>,
home_screens: Query<(), With<crate::home_plugin::HomeScreen>>,
) {
if !session.active {
return;
}
if paused.is_some_and(|p| p.0) {
// Mirrors `tick_elapsed_time`: pause while the launch / mode-picker
// Home modal is up so the countdown doesn't burn while the player
// is choosing what to play next.
if paused.is_some_and(|p| p.0) || !home_screens.is_empty() {
return;
}
session.remaining_secs -= time.delta_secs();