Skip to content

Commit

Permalink
Fix name of equipment click audio
Browse files Browse the repository at this point in the history
  • Loading branch information
Enet4 committed Nov 25, 2024
1 parent 25155f5 commit 4c76330
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ fn repeat_texture(settings: &mut ImageLoaderSettings) {
pub struct AudioHandles {
pub enabled: bool,
pub zipclick: Handle<AudioSource>,
pub equipmentclick01: Handle<AudioSource>,
pub equipmentclick1: Handle<AudioSource>,
pub dread: Handle<AudioSource>,
}

impl FromWorld for AudioHandles {
fn from_world(world: &mut World) -> Self {
let asset_server = world.get_resource::<AssetServer>().unwrap();
let zipclick = asset_server.load("audio/zipclick.ogg");
let equipmentclick01 = asset_server.load("audio/equipmentclick01.ogg");
let equipmentclick1 = asset_server.load("audio/equipmentclick1.ogg");
let dread = asset_server.load("audio/dread.ogg");

AudioHandles {
enabled: true,
zipclick,
equipmentclick01,
equipmentclick1,
dread,
}
}
Expand All @@ -78,8 +78,8 @@ impl AudioHandles {
self.play_impl(cmd, &self.zipclick)
}

pub fn play_equipmentclick01<'a>(&self, cmd: &'a mut Commands) -> Option<EntityCommands<'a>> {
self.play_impl(cmd, &self.equipmentclick01)
pub fn play_equipmentclick1<'a>(&self, cmd: &'a mut Commands) -> Option<EntityCommands<'a>> {
self.play_impl(cmd, &self.equipmentclick1)
}

pub fn play_dread<'a>(&self, cmd: &'a mut Commands) -> Option<EntityCommands<'a>> {
Expand Down
4 changes: 2 additions & 2 deletions src/live/weapon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ pub fn weapon_keyboard_input(
change_weapon.send(ChangeWeapon { num });

// play sound
audio_handles.play_equipmentclick01(&mut cmd);
audio_handles.play_equipmentclick1(&mut cmd);
break;
} else {
cmd.entity(entity).remove::<WeaponSelected>();
Expand Down Expand Up @@ -430,7 +430,7 @@ pub fn weapon_button_action(
}

// play sounds
audio_handles.play_equipmentclick01(&mut cmd);
audio_handles.play_equipmentclick1(&mut cmd);

// traverse all buttons to update the selected weapon
for e in &mut weapon_button_q {
Expand Down

0 comments on commit 4c76330

Please sign in to comment.