From 0c3105542266eb7626fa8df46f3c28b58dfceabf Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 11 Apr 2024 20:47:11 +0200 Subject: [PATCH] add key binding F7 to restart the game --- README.md | 1 + src/actor.rs | 4 ++++ src/settings.rs | 10 +++++----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f6bf66f..9fc9d72 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ Links: - R: Rotate (hold & move mouse) - E: Interact: Talk to people, enter vehicles - Q: Exit vehicle +- F7: Restart game - JKULIO: Mouseless camera rotation - Augmented Reality: (toggle with Tab) - Left click: Target objects diff --git a/src/actor.rs b/src/actor.rs index 78073d3..80b04a4 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -241,6 +241,7 @@ pub fn handle_input( q_vehicles: Query<(Entity, &Transform), (With, Without, Without)>, mut ew_conv: EventWriter, mut ew_vehicle: EventWriter, + mut ew_playerdies: EventWriter, q_player_drives: Query>, ) { if q_camera.is_empty() || player.is_empty() { @@ -294,6 +295,9 @@ pub fn handle_input( break; } } + else if keyboard_input.just_pressed(settings.key_restart) { + ew_playerdies.send(PlayerDiesEvent(DamageType::Mental)); + } } pub fn handle_vehicle_enter_exit( diff --git a/src/settings.rs b/src/settings.rs index f571737..4ae94e0 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -105,7 +105,7 @@ impl Default for Settings { key_zoom: MouseButton::Right, key_togglehud: KeyCode::Tab, key_exit: KeyCode::Escape, - key_restart: KeyCode::F12, + key_restart: KeyCode::F7, key_fullscreen: KeyCode::F11, key_forward: KeyCode::KeyW, key_back: KeyCode::KeyS, @@ -139,12 +139,12 @@ impl Default for Settings { key_cheat_stop: KeyCode::KeyC, key_cheat_speed: KeyCode::KeyV, key_cheat_speed_backward: KeyCode::KeyB, - key_cheat_pizza: KeyCode::F8, - key_cheat_farview1: KeyCode::F9, - key_cheat_farview2: KeyCode::F10, + key_cheat_pizza: KeyCode::F9, + key_cheat_farview1: KeyCode::F10, + key_cheat_farview2: KeyCode::F12, key_cheat_adrenaline_zero: KeyCode::F5, key_cheat_adrenaline_mid: KeyCode::F6, - key_cheat_adrenaline_max: KeyCode::F7, + key_cheat_adrenaline_max: KeyCode::F8, key_cheat_die: KeyCode::KeyZ, } }