diff --git a/src/audio.rs b/src/audio.rs index 689e8b1..f63d966 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -7,7 +7,6 @@ const ASSET_SWITCH: &str = "sounds/typosonic-typing-192811-crop.ogg"; const ASSET_INCOMING_MESSAGE: &str = "sounds/connect.ogg"; const ASSET_PING: &str = "sounds/connect.ogg"; const ASSET_CONNECT: &str = "sounds/connect.ogg"; -const ASSET_RADIO: &str = "external/LP - Girls Go Wild (Official Music Video) [M7XRN0oHGIM].mp3"; const ASSET_BGM: &str = "music/dead-space-style-ambient-music.ogg"; const ASSET_THRUSTER: &str = "sounds/thruster.ogg"; const ASSET_ROCKET: &str = "sounds/rocket.ogg"; @@ -39,11 +38,9 @@ pub enum Sfx { #[derive(Event)] pub struct PlaySfxEvent(pub Sfx); #[derive(Event)] pub struct ToggleMusicEvent(); #[derive(Component)] pub struct ComponentBGM; -#[derive(Component)] pub struct ComponentRadio; #[derive(Component)] pub struct ComponentThrusterSound; #[derive(Component)] pub struct ComponentRocketSound; #[derive(Component)] struct SoundBGM(Handle); -#[derive(Component)] pub struct SoundRadio(Handle); #[derive(Resource)] pub struct SoundClick(Handle); #[derive(Resource)] pub struct SoundSwitch(Handle); #[derive(Resource)] pub struct SoundIncomingMessage(Handle); @@ -67,17 +64,6 @@ pub fn setup( }, }, )); - commands.spawn(( - ComponentRadio, - AudioBundle { - source: SoundBGM(asset_server.load(ASSET_RADIO)).0.clone(), - settings: PlaybackSettings { - mode: PlaybackMode::Loop, - paused: !settings.hud_active || settings.mute_music, - ..default() - }, - }, - )); if !settings.mute_sfx { commands.spawn(( AudioBundle { @@ -183,28 +169,16 @@ pub fn str2sfx(sfx_label: &str) -> Sfx { pub fn update_music( mut events: EventReader, bgm_controller: Query<&AudioSink, With>, - radio_controller: Query<&AudioSink, With>, settings: Res, ) { if !events.is_empty() { events.clear(); if let Ok(bgm_sink) = bgm_controller.get_single() { - if let Ok(radio_sink) = radio_controller.get_single() { - if settings.mute_music { - radio_sink.pause(); - bgm_sink.pause(); - } - else { - if settings.hud_active { - radio_sink.play(); - bgm_sink.pause(); - println!("pausing"); - } else { - radio_sink.pause(); - bgm_sink.play(); - println!("playing"); - } - } + if settings.mute_music { + bgm_sink.pause(); + } + else { + bgm_sink.play(); } } }