From 363ddc9b75800eadf540113c4664b3a48f429df8 Mon Sep 17 00:00:00 2001 From: funman300 Date: Fri, 24 Apr 2026 19:28:13 -0700 Subject: [PATCH] feat(engine): surface daily/weekly completions as toasts + progression panel Phase 6 part 3 (partial): - AnimationPlugin now shows a 3-second toast on DailyChallengeCompletedEvent and WeeklyGoalCompletedEvent. - Stats overlay (S key) appends a Progression section with level, total XP, daily streak, and a live Weekly Goals list pulling from WEEKLY_GOALS. Special modes (Time Attack / Challenge / Zen) and unlock UI deferred. Co-Authored-By: Claude Opus 4.7 --- solitaire_engine/src/animation_plugin.rs | 34 +++++++++++++++++ solitaire_engine/src/stats_plugin.rs | 48 +++++++++++++++++++++--- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/solitaire_engine/src/animation_plugin.rs b/solitaire_engine/src/animation_plugin.rs index cfdff29..87f25bc 100644 --- a/solitaire_engine/src/animation_plugin.rs +++ b/solitaire_engine/src/animation_plugin.rs @@ -7,10 +7,12 @@ use bevy::prelude::*; use crate::achievement_plugin::display_name_for; use crate::card_plugin::CardEntity; +use crate::daily_challenge_plugin::DailyChallengeCompletedEvent; use crate::events::{AchievementUnlockedEvent, GameWonEvent}; use crate::game_plugin::GameMutation; use crate::layout::LayoutResource; use crate::progress_plugin::LevelUpEvent; +use crate::weekly_goals_plugin::WeeklyGoalCompletedEvent; /// Duration of a card slide (move) animation in seconds. pub const SLIDE_SECS: f32 = 0.15; @@ -18,6 +20,8 @@ pub const SLIDE_SECS: f32 = 0.15; const WIN_TOAST_SECS: f32 = 4.0; const ACHIEVEMENT_TOAST_SECS: f32 = 3.0; const LEVELUP_TOAST_SECS: f32 = 3.0; +const DAILY_TOAST_SECS: f32 = 3.0; +const WEEKLY_TOAST_SECS: f32 = 3.0; const CASCADE_STAGGER: f32 = 0.05; const CASCADE_DURATION: f32 = 0.5; @@ -53,6 +57,8 @@ impl Plugin for AnimationPlugin { app.add_event::() .add_event::() .add_event::() + .add_event::() + .add_event::() .add_systems( Update, ( @@ -60,6 +66,8 @@ impl Plugin for AnimationPlugin { handle_win_cascade, handle_achievement_toast, handle_levelup_toast, + handle_daily_toast, + handle_weekly_toast, tick_toasts, ) .after(GameMutation), @@ -147,6 +155,32 @@ fn handle_levelup_toast(mut commands: Commands, mut events: EventReader, +) { + for ev in events.read() { + spawn_toast( + &mut commands, + format!("Daily Challenge Complete! (Streak: {})", ev.streak), + DAILY_TOAST_SECS, + ); + } +} + +fn handle_weekly_toast( + mut commands: Commands, + mut events: EventReader, +) { + for ev in events.read() { + spawn_toast( + &mut commands, + format!("Weekly Goal: {}", ev.description), + WEEKLY_TOAST_SECS, + ); + } +} + fn tick_toasts( mut commands: Commands, time: Res