From 0a76c089d0ba445c642b1c9639fe52ac5aad913c Mon Sep 17 00:00:00 2001 From: root Date: Mon, 27 Apr 2026 03:04:18 +0000 Subject: [PATCH] feat(engine): hide score and timer in Zen mode per spec Zen mode is intended for relaxed play with no performance pressure. The HUD now clears score and elapsed-time displays when GameMode::Zen is active, matching the ARCHITECTURE.md spec ("No timer. No score display."). The mode badge still shows "ZEN" so the player knows which mode they're in. Co-Authored-By: Claude Sonnet 4.6 --- solitaire_engine/src/hud_plugin.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/solitaire_engine/src/hud_plugin.rs b/solitaire_engine/src/hud_plugin.rs index 9d54333..4bc149d 100644 --- a/solitaire_engine/src/hud_plugin.rs +++ b/solitaire_engine/src/hud_plugin.rs @@ -83,8 +83,14 @@ fn update_hud( // Score, moves, and mode only need updating when the game state changes. if game.is_changed() { let g = &game.0; + let is_zen = g.mode == GameMode::Zen; if let Ok(mut t) = score_q.get_single_mut() { - **t = format!("Score: {}", g.score); + // Zen mode suppresses score display per spec ("No score display"). + **t = if is_zen { + String::new() + } else { + format!("Score: {}", g.score) + }; } if let Ok(mut t) = moves_q.get_single_mut() { **t = format!("Moves: {}", g.move_count); @@ -103,8 +109,10 @@ fn update_hud( } // Time display: show Time Attack countdown every frame when active; - // otherwise show game elapsed time (updates once per second via game.is_changed()). - let update_time = ta_active || game.is_changed(); + // Zen mode suppresses the timer per spec ("No timer"). + // Otherwise show game elapsed time (updates once per second via game.is_changed()). + let is_zen = game.0.mode == GameMode::Zen; + let update_time = (ta_active || game.is_changed()) && !is_zen; if update_time { if let Ok(mut t) = time_q.get_single_mut() { if let Some(ta) = time_attack.as_ref().filter(|ta| ta.active) { @@ -119,6 +127,11 @@ fn update_hud( **t = format!("{m}:{s:02}"); } } + } else if is_zen && game.is_changed() { + // Clear the time display when entering Zen mode. + if let Ok(mut t) = time_q.get_single_mut() { + **t = String::new(); + } } }