click3.ogg: add new sound for targeting and menu cursor movement

This commit is contained in:
yuni 2024-09-17 01:10:55 +02:00
parent 4b42f441dc
commit 6704056d3a
5 changed files with 8 additions and 5 deletions

BIN
assets/sounds/click3.ogg Normal file

Binary file not shown.

View file

@ -64,6 +64,7 @@ const PATHS: &[(SfxType, Sfx, &str)] = &[
(SfxType::OneOff, Sfx::GaspRelief, "sounds/gasprelief.ogg"), (SfxType::OneOff, Sfx::GaspRelief, "sounds/gasprelief.ogg"),
(SfxType::OneOff, Sfx::Achieve, "sounds/achieve.ogg"), (SfxType::OneOff, Sfx::Achieve, "sounds/achieve.ogg"),
(SfxType::OneOff, Sfx::Click, "sounds/click.ogg"), (SfxType::OneOff, Sfx::Click, "sounds/click.ogg"),
(SfxType::OneOff, Sfx::Click3, "sounds/click3.ogg"),
(SfxType::OneOff, Sfx::Connect, "sounds/connect.ogg"), (SfxType::OneOff, Sfx::Connect, "sounds/connect.ogg"),
(SfxType::OneOff, Sfx::Crash, "sounds/crash.ogg"), (SfxType::OneOff, Sfx::Crash, "sounds/crash.ogg"),
(SfxType::OneOff, Sfx::Drink, "sounds/drink.ogg"), (SfxType::OneOff, Sfx::Drink, "sounds/drink.ogg"),
@ -89,6 +90,7 @@ pub enum Sfx {
BGMActualJupiterRecording, BGMActualJupiterRecording,
BGMTakeoff, BGMTakeoff,
Click, Click,
Click3,
Connect, Connect,
Crash, Crash,
Drink, Drink,
@ -117,6 +119,7 @@ pub fn str2sfx(sfx_label: &str) -> Sfx {
"exit" => Sfx::ExitVehicle, "exit" => Sfx::ExitVehicle,
"honk" => Sfx::Honk, "honk" => Sfx::Honk,
"click" => Sfx::Click, "click" => Sfx::Click,
"click3" => Sfx::Click3,
"drink" => Sfx::Drink, "drink" => Sfx::Drink,
"woosh" => Sfx::Woosh, "woosh" => Sfx::Woosh,
"zoom" => Sfx::Zoom, "zoom" => Sfx::Zoom,

View file

@ -218,6 +218,7 @@ pub fn handle_game_event(
} }
} }
GameEvent::SetMenu(turn) => { GameEvent::SetMenu(turn) => {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click));
settings.menu_active = turn.to_bool(settings.menu_active); settings.menu_active = turn.to_bool(settings.menu_active);
for mut window in &mut q_window { for mut window in &mut q_window {
window.cursor.grab_mode = if settings.menu_active { window.cursor.grab_mode = if settings.menu_active {

View file

@ -1080,7 +1080,6 @@ fn handle_input(
fn handle_target_event( fn handle_target_event(
mut commands: Commands, mut commands: Commands,
settings: Res<Settings>,
mut er_target: EventReader<TargetEvent>, mut er_target: EventReader<TargetEvent>,
mut ew_sfx: EventWriter<audio::PlaySfxEvent>, mut ew_sfx: EventWriter<audio::PlaySfxEvent>,
mut ew_achievement: EventWriter<game::AchievementEvent>, mut ew_achievement: EventWriter<game::AchievementEvent>,
@ -1105,8 +1104,8 @@ fn handle_target_event(
} }
} }
} }
if play_sfx && !settings.mute_sfx { if play_sfx {
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click)); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click3));
} }
break; // Only accept a single event per frame break; // Only accept a single event per frame
} }

View file

@ -543,7 +543,7 @@ pub fn handle_input(
} else { } else {
menustate.cursor.saturating_sub(1) menustate.cursor.saturating_sub(1)
}; };
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click)); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click3));
ew_updatemenu.send(UpdateMenuEvent); ew_updatemenu.send(UpdateMenuEvent);
} }
if keyboard_input.just_pressed(settings.key_back) if keyboard_input.just_pressed(settings.key_back)
@ -555,7 +555,7 @@ pub fn handle_input(
} else { } else {
menustate.cursor.saturating_add(1) menustate.cursor.saturating_add(1)
}; };
ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click)); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click3));
ew_updatemenu.send(UpdateMenuEvent); ew_updatemenu.send(UpdateMenuEvent);
} }
if keyboard_input.just_pressed(settings.key_interact) if keyboard_input.just_pressed(settings.key_interact)