Revert "reset settings on death/restart"

This reverts commit 3676fd444c.
This commit is contained in:
yuni 2024-04-11 21:12:56 +02:00
parent 3676fd444c
commit cb698cc3b2
2 changed files with 5 additions and 3 deletions

View file

@ -423,13 +423,12 @@ fn handle_player_death(
mut ew_sfx: EventWriter<audio::PlaySfxEvent>, mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
mut ew_effect: EventWriter<effects::SpawnEffectEvent>, mut ew_effect: EventWriter<effects::SpawnEffectEvent>,
mut log: ResMut<hud::Log>, mut log: ResMut<hud::Log>,
mut settings: ResMut<settings::Settings>, settings: Res<settings::Settings>,
) { ) {
for death in er_playerdies.read() { for death in er_playerdies.read() {
if settings.god_mode { if settings.god_mode {
return; return;
} }
settings.reset();
for entity in &q_noscenes { for entity in &q_noscenes {
cmd.entity(entity).despawn(); cmd.entity(entity).despawn();
} }

View file

@ -77,7 +77,7 @@ fn setup(
fn handle_input( fn handle_input(
keyboard_input: Res<ButtonInput<KeyCode>>, keyboard_input: Res<ButtonInput<KeyCode>>,
settings: Res<settings::Settings>, mut settings: ResMut<settings::Settings>,
mut app_exit_events: ResMut<Events<bevy::app::AppExit>>, mut app_exit_events: ResMut<Events<bevy::app::AppExit>>,
mut windows: Query<&mut Window, With<PrimaryWindow>>, mut windows: Query<&mut Window, With<PrimaryWindow>>,
) { ) {
@ -93,4 +93,7 @@ fn handle_input(
} }
} }
} }
if keyboard_input.just_pressed(settings.key_restart) {
settings.reset();
}
} }