Adds a one-slot in-memory debug save state. D-pad left stores the current single-player state and D-pad right restores it. Reviewed-on: #6 Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #6.
This commit is contained in:
@@ -14,6 +14,8 @@ use enum_cycling_derive::EnumCycle;
|
||||
|
||||
use crate::{AppState, player::Player, replay::StopReplayRecording};
|
||||
|
||||
mod save_state;
|
||||
|
||||
pub const PLAYER_DEBUG_ROW_COUNT: usize = 6;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Reflect)]
|
||||
@@ -378,6 +380,9 @@ impl Plugin for DebugToolsPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.init_resource::<DebugSettings>()
|
||||
.init_resource::<FrameStepState>()
|
||||
.init_resource::<save_state::DebugSaveState>()
|
||||
.add_systems(OnEnter(AppState::InMatch), save_state::clear)
|
||||
.add_systems(OnExit(AppState::InMatch), save_state::clear)
|
||||
.add_systems(
|
||||
PreUpdate,
|
||||
prepare_frame_step
|
||||
@@ -385,6 +390,13 @@ impl Plugin for DebugToolsPlugin {
|
||||
.before(RunGgrsSystems)
|
||||
.run_if(in_state(AppState::InMatch)),
|
||||
)
|
||||
.add_systems(
|
||||
PreUpdate,
|
||||
save_state::save_or_restore
|
||||
.after(InputSystems)
|
||||
.before(RunGgrsSystems)
|
||||
.run_if(in_state(AppState::InMatch)),
|
||||
)
|
||||
.add_systems(PreUpdate, restore_frame_step_time.after(RunGgrsSystems))
|
||||
.add_systems(
|
||||
Update,
|
||||
|
||||
Reference in New Issue
Block a user