Files
settled-reach/server/src/simulation/time_plugin.rs
T
jpmschweitzerandClaude Fable 5 6bda9f1697 feat(simulation): auto-pause sim on implant-fullscreen — inspection substrate (T-970)
D-226 layer 1. World-advancing phases gated on pause: Movement/Storyteller/Knowledge/TickAdvance set-gated via sim_not_paused; Simulation + Economy gated per-system at their registration sites — collect_sound_events and serve_econ_state_query stay unconditioned (transient-buffer clear + paused-allowed query; set-gating Simulation leaked a stale tick-7 footstep into frozen snapshots — caught by golden_suite, fixed without touching the fixture; regression test encodes the bug shape). New PlayerAction::AutoPause/AutoResume + AutoPauseState resource implement Option A reconciliation: auto-resume only fires if auto-pause caused the pause; manual pause and Half rate survive implant open/close. PauseParams SystemParam bundle keeps process_player_input under the 16-param ceiling (BookmarkInputParams precedent). Client: HudGroups.gameplay_occluded now sends AutoPause/AutoResume via send_named_action; 5 gdUnit tests + 7 Rust tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 15:44:56 +02:00

38 lines
1.4 KiB
Rust

//! Time and streaming plugin — tick advancement, chunk streaming, news ticker.
//!
//! Systems span three phases:
//! - PreInput: chunk_streaming (loads chunks before input processing)
//! - Snapshot: tick_news_ticker (assembles display content)
//! - TickAdvance: advance_tick (must be last in the pipeline)
use bevy_app::prelude::*;
use bevy_ecs::schedule::IntoScheduleConfigs;
use crate::tick_phases::TickPhase;
pub struct TimePlugin;
impl Plugin for TimePlugin {
fn build(&self, app: &mut App) {
app.init_resource::<super::time::SimulationTime>()
// T-970 (D-226 layer 1): tracks whether the current pause was
// auto-triggered (implant fullscreen) vs. manual (D-088).
.init_resource::<super::time::AutoPauseState>()
.init_resource::<super::chunk_streaming::ChunkLoadRadius>()
.init_resource::<super::chunk_streaming::ChunkStreamingCadence>()
.init_resource::<super::ticker::TickerPool>()
.add_systems(
Update,
super::chunk_streaming::chunk_streaming.in_set(TickPhase::PreInput),
)
.add_systems(
Update,
super::ticker::tick_news_ticker.in_set(TickPhase::Snapshot),
)
.add_systems(
Update,
super::time::advance_tick.in_set(TickPhase::TickAdvance),
);
}
}