diff --git a/README.md b/README.md index 0f60c1a..8b10214 100644 --- a/README.md +++ b/README.md @@ -293,6 +293,7 @@ python -m http.server -d wasm - https://pixabay.com/sound-effects/high-energy-humming-195612 - https://pixabay.com/sound-effects/box-crash-106687 - https://pixabay.com/sound-effects/electric-fan-motor-blades-removed-13169 + - https://pixabay.com/sound-effects/whoosh-blow-flutter-shortwav-14678/ - Music: [Cinematic Cello](https://pixabay.com/music/build-up-scenes-cinematic-cello-115667) by [Aleksey Chistilin](https://pixabay.com/users/lexin_music-28841948/), [Pixabay Content License](https://pixabay.com/service/license-summary) - Star chart based on the [HYG Stellar database](https://github.com/astronexus/HYG-Database) - Font Yupiter-Regular.ttf is placed under the SIL OPEN FONT LICENSE Version 1.1 and is based on: diff --git a/assets/sounds/woosh.ogg b/assets/sounds/woosh.ogg new file mode 100644 index 0000000..782799b Binary files /dev/null and b/assets/sounds/woosh.ogg differ diff --git a/src/audio.rs b/src/audio.rs index 4aa8a1e..69ed435 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -16,6 +16,7 @@ use crate::var; const ASSET_CLICK: &str = "sounds/click-button-140881-crop.ogg"; const ASSET_SWITCH: &str = "sounds/typosonic-typing-192811-crop.ogg"; +const ASSET_WOOSH: &str = "sounds/woosh.ogg"; const ASSET_INCOMING_MESSAGE: &str = "sounds/connect.ogg"; const ASSET_PING: &str = "sounds/connect.ogg"; const ASSET_CONNECT: &str = "sounds/connect.ogg"; @@ -44,6 +45,7 @@ pub enum Sfx { IncomingChatMessage, Click, Switch, + Woosh, Ping, Connect, EnterVehicle, @@ -62,6 +64,7 @@ pub enum Sfx { #[derive(Component)] struct SoundBGM(Handle); #[derive(Resource)] pub struct SoundClick(Handle); #[derive(Resource)] pub struct SoundSwitch(Handle); +#[derive(Resource)] pub struct SoundWoosh(Handle); #[derive(Resource)] pub struct SoundIncomingMessage(Handle); #[derive(Resource)] pub struct SoundPing(Handle); #[derive(Resource)] pub struct SoundConnect(Handle); @@ -135,6 +138,7 @@ pub fn setup( )); commands.insert_resource(SoundClick(asset_server.load(ASSET_CLICK))); commands.insert_resource(SoundSwitch(asset_server.load(ASSET_SWITCH))); + commands.insert_resource(SoundWoosh(asset_server.load(ASSET_WOOSH))); commands.insert_resource(SoundIncomingMessage(asset_server.load(ASSET_INCOMING_MESSAGE))); commands.insert_resource(SoundPing(asset_server.load(ASSET_PING))); commands.insert_resource(SoundConnect(asset_server.load(ASSET_CONNECT))); @@ -167,6 +171,7 @@ pub fn play_sfx( mut events_sfx: EventReader, sound_click: Res, sound_switch: Res, + sound_woosh: Res, sound_incoming_message: Res, sound_ping: Res, sound_connect: Res, @@ -186,6 +191,7 @@ pub fn play_sfx( source: match sfx.0 { Sfx::Switch => sound_switch.0.clone(), Sfx::Click => sound_click.0.clone(), + Sfx::Woosh => sound_woosh.0.clone(), Sfx::IncomingChatMessage => sound_incoming_message.0.clone(), Sfx::Ping => sound_ping.0.clone(), Sfx::Connect => sound_connect.0.clone(), diff --git a/src/camera.rs b/src/camera.rs index c7efcdb..6d33e18 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -291,6 +291,9 @@ pub fn handle_input( } if keyboard_input.just_pressed(settings.key_map) { settings.map_active ^= true; + if settings.map_active { + ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Woosh)); + } *mapcam = MapCam::default(); ew_updateoverlays.send(hud::UpdateOverlayVisibility); }