diff --git a/src/hud.rs b/src/hud.rs index 3123558..aeb79b6 100644 --- a/src/hud.rs +++ b/src/hud.rs @@ -598,7 +598,6 @@ fn handle_input( ew_togglemusic.send(audio::ToggleMusicEvent()); } if mouse_input.just_pressed(settings.key_selectobject) { - //ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Switch)); if q_target.is_empty() { if let Ok(camtrans) = q_camera.get_single() { let objects: Vec<(Entity, &Transform)> = q_objects @@ -607,12 +606,14 @@ fn handle_input( .collect(); if let (Some(entity), _dist) = camera::find_closest_target::(objects, camtrans) { commands.entity(entity).insert(IsTargeted); + ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click)); } } } else { for entity in &q_target { commands.entity(entity).remove::(); + ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Click)); } } }