From 5f4850555ac2fd62009cffd5e98ea04c081bbaf7 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 1 Dec 2026 18:38:40 +0400 Subject: feat(audio): announce exhausted weapon ammunition --- apps/fparkan-game/src/player_fire.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/fparkan-game/src/player_fire.rs b/apps/fparkan-game/src/player_fire.rs index cf24da35..aa861fc5 100644 --- a/apps/fparkan-game/src/player_fire.rs +++ b/apps/fparkan-game/src/player_fire.rs @@ -5,6 +5,7 @@ use super::{ use fparkan_runtime::{ loaded_mission_assets, projectile_sight_target, turret_sight_points, FiringEffectInstance, + PlayerWeaponWarning, }; impl StaticVulkanApp { @@ -40,15 +41,19 @@ impl StaticVulkanApp { if let Some(engine) = &mut self.mission_engine { weapons.publish_control_energy(engine, cockpit.handle); } - for slot in weapons.take_low_charge_warnings() { + for (slot, warning) in weapons.take_warnings() { if let Some(audio) = &mut self.audio { - match audio.queue_game_voice("VOICE_WEAP_ENERGY_OUT") { + let notice = match warning { + PlayerWeaponWarning::AmmoEmpty => "VOICE_WEAP_AMMO_OUT", + PlayerWeaponWarning::LowCharge => "VOICE_WEAP_ENERGY_OUT", + }; + match audio.queue_game_voice(notice) { Ok(resource) => eprintln!( "player_weapon_voice slot={} resource={resource} queue_time_ms={clock_ms}", slot + 1 ), Err(error) => eprintln!( - "sim_coverage mission_voice_unavailable=1 notice=VOICE_WEAP_ENERGY_OUT reason={error}" + "sim_coverage mission_voice_unavailable=1 notice={notice} reason={error}" ), } } -- cgit v1.2.3