From 115cd1b46d71c54795d611dfe624db67efdd0aae Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 20 Apr 2024 04:48:17 +0200 Subject: [PATCH] tweak key bindings --- README.md | 6 +++--- src/audio.rs | 4 ++-- src/data/keybindings.in | 5 +++-- src/var.rs | 6 +++++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b10e621..50ab081 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,10 @@ Links: - Tab: Toggle HUD/AR - F11: Toggle fullscreen - F: Toggle 3rd person view - - \`: Toggle map + - M: Toggle map - Y: Toggle rotation stabilizer - - T: Toggle music - - M: Toggle sound effects + - F4: Toggle music + - F3: Toggle sound effects - Cheats - G: Toggle god mode / cheats - V/B: Impossible acceleration forward/backward diff --git a/src/audio.rs b/src/audio.rs index 54136a9..2ee3285 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -137,12 +137,12 @@ pub fn toggle_bgm( mut evwriter_sfx: EventWriter, mut settings: ResMut, ) { - if keyboard_input.just_pressed(KeyCode::KeyT) { + if keyboard_input.just_pressed(settings.key_toggle_music) { settings.mute_music ^= true; evwriter_sfx.send(PlaySfxEvent(Sfx::Click)); evwriter_toggle.send(ToggleMusicEvent()); } - if keyboard_input.just_pressed(KeyCode::KeyM) { + if keyboard_input.just_pressed(settings.key_toggle_sfx) { settings.mute_sfx ^= true; evwriter_sfx.send(PlaySfxEvent(Sfx::Click)); evwriter_toggle.send(ToggleMusicEvent()); diff --git a/src/data/keybindings.in b/src/data/keybindings.in index b81e13a..06b5782 100644 --- a/src/data/keybindings.in +++ b/src/data/keybindings.in @@ -3,10 +3,11 @@ C: Impossibly instant stopping [CHEAT] Shift+V/B: Same as V/B, but a thousand times faster [CHEAT] V/B: Impossible acceleration forward/backward [CHEAT] G: Toggle god mode / cheats [CHEAT] -M: Toggle sound effects -T: Toggle music +M: Toggle map Y: Toggle rotation stabilizer F: Toggle 3rd person view +F3: Toggle sound effects +F4: Toggle music F11: Toggle fullscreen Tab: Toggle HUD + Augmented Reality Right click: Zoom [AUGMENTED REALITY ONLY] diff --git a/src/var.rs b/src/var.rs index 5e2b6b0..e3e2f86 100644 --- a/src/var.rs +++ b/src/var.rs @@ -76,6 +76,8 @@ pub struct Settings { pub key_mouseright: KeyCode, pub key_rotateleft: KeyCode, pub key_rotateright: KeyCode, + pub key_toggle_sfx: KeyCode, + pub key_toggle_music: KeyCode, pub key_reply1: KeyCode, pub key_reply2: KeyCode, pub key_reply3: KeyCode, @@ -155,7 +157,7 @@ impl Default for Settings { rotation_stabilizer_active: true, key_selectobject: MouseButton::Left, key_zoom: MouseButton::Right, - key_map: KeyCode::Backquote, + key_map: KeyCode::KeyM, key_map_zoom_out: KeyCode::ShiftLeft, key_map_zoom_in: KeyCode::ControlLeft, //key_map_zoom_out_wheel: KeyCode::Shift, @@ -184,6 +186,8 @@ impl Default for Settings { key_mouseright: KeyCode::KeyL, key_rotateleft: KeyCode::KeyU, key_rotateright: KeyCode::KeyO, + key_toggle_sfx: KeyCode::F3, + key_toggle_music: KeyCode::F4, key_reply1: KeyCode::Digit1, key_reply2: KeyCode::Digit2, key_reply3: KeyCode::Digit3,