From 5b1d6588f93a8cf52cebacaa14ec94da1cf366aa Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 3 Apr 2024 14:27:44 +0200 Subject: [PATCH] properly mute reaction wheel sounds --- README.md | 20 ++++++++++---------- src/camera.rs | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index a5d07d8..f2e3cbd 100644 --- a/README.md +++ b/README.md @@ -17,23 +17,23 @@ Key features: # Key Bindings -- Space: stop moving +- Space: slow down - AWSD: accelerate - Shift and Ctrl: accelerate up and down - JKLUIO: mouseless camera rotation -- e: interact: talk to people, enter vehicles -- t: toggle music (NOTE: currently no music is included in the git repo) -- m: mute sound effects -- q: exit vehicle -- r: rotate (hold r while moving the mouse) -- f: toggle 3rd person view +- E: interact: talk to people, enter vehicles +- T: toggle music (NOTE: currently no music is included in the git repo) +- M: mute sound effects +- Q: exit vehicle +- R: rotate (hold r while moving the mouse) +- F: toggle 3rd person view - TAB: toggle augmented reality overlay (HUD, low-light amplifier) Cheats: -- v/b: Impossible acceleration forward/backward -- Shift+v/b: Same as v/b, but a thousand times faster -- c: Impossible instant stopping +- V/B: Impossible acceleration forward/backward +- Shift+V/B: Same as V/B, but a thousand times faster +- C: Impossible instant stopping # System Requirements diff --git a/src/camera.rs b/src/camera.rs index a8f660c..520d668 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -233,7 +233,7 @@ fn apply_input_to_player( } v.0 += acceleration_total; engine.current_warmup = (engine.current_warmup + dt / engine.warmup_seconds).clamp(0.0, 1.0); - play_thruster_sound = !settings.mute_sfx; + play_thruster_sound = true; } else { engine.current_warmup = (engine.current_warmup - dt / engine.warmup_seconds).clamp(0.0, 1.0); @@ -298,7 +298,7 @@ fn apply_input_to_player( let volume = sink.volume(); let speed = sink.speed(); let action = pitch_yaw_rot.length_squared().powf(0.2) * 0.0005; - if play_reactionwheel_sound { + if play_reactionwheel_sound && !settings.mute_sfx { sink.set_volume((volume + action).clamp(0.0, 1.0)); sink.set_speed((speed + action * 0.2).clamp(0.2, 0.5)); sink.play() @@ -312,21 +312,21 @@ fn apply_input_to_player( } } if let Ok(sink) = thruster_sound_controller.get_single() { - if play_thruster_sound && engine.engine_type == actor::EngineType::Monopropellant { + if play_thruster_sound && !settings.mute_sfx && engine.engine_type == actor::EngineType::Monopropellant { sink.play() } else { sink.pause() } } if let Ok(sink) = rocket_sound_controller.get_single() { - if play_thruster_sound && engine.engine_type == actor::EngineType::Rocket { + if play_thruster_sound && !settings.mute_sfx && engine.engine_type == actor::EngineType::Rocket { sink.play() } else { sink.pause() } } if let Ok(sink) = ion_sound_controller.get_single() { - if play_thruster_sound && engine.engine_type == actor::EngineType::Ion { + if play_thruster_sound && !settings.mute_sfx && engine.engine_type == actor::EngineType::Ion { sink.play() } else { sink.pause()