use crate::StaticVulkanApp; use fparkan_runtime::cockpit_indicators::cockpit_indicators; use fparkan_runtime::{ at_research_laboratory, order_lab_research, toggle_camouflage, toggle_self_repair, }; impl StaticVulkanApp { pub(super) fn toggle_player_camouflage(&mut self) { if let Some((engine, cockpit)) = self.mission_engine.as_mut().zip(self.cockpit) { toggle_camouflage(engine, cockpit); } } pub(super) fn announce_player_camouflage(&mut self) { let Some((engine, cockpit)) = self .mission_engine .as_ref() .zip(self.cockpit) .filter(|_| self.command_view.is_none() && self.demo_camera.is_none()) else { return; }; let Some(state) = cockpit_indicators(engine, cockpit) else { return; }; let changed = if state.camouflage { self.camouflage_announced.insert(cockpit.handle) } else { self.camouflage_announced.remove(&cockpit.handle) }; if changed { if let Some(audio) = &mut self.audio { let voice = if state.camouflage { "VOICE_CHAMELEON_SYS_ON" } else { "VOICE_CHAMELEON_SYS_OFF" }; if let Err(error) = audio.queue_game_voice(voice) { eprintln!("camouflage_voice_unavailable voice={voice} reason={error}"); } } } } pub(super) fn handle_player_service(&mut self, clock_ms: u32) { let (true, Some(cockpit), Some(engine)) = ( std::mem::take(&mut self.player_service_pressed), self.cockpit, self.mission_engine.as_mut(), ) else { return; }; if self.boarded_hero_index.is_none() && at_research_laboratory(engine, cockpit) { match order_lab_research(engine, cockpit, clock_ms) { Ok((component, duration)) => { eprintln!("laboratory_research_order component={component} duration_ms={duration} queue_time_ms={clock_ms}"); } Err(error) => eprintln!("laboratory_research_rejected {error}"), } return; } if let Some(enabled) = toggle_self_repair(engine, cockpit) { eprintln!("player_self_repair enabled={enabled} queue_time_ms={clock_ms}"); if let Some(audio) = &mut self.audio { let voice = if enabled { "VOICE_REPAIR_SYS_ON" } else { "VOICE_REPAIR_SYS_OFF" }; if let Err(error) = audio.queue_game_voice(voice) { eprintln!( "sim_coverage mission_voice_unavailable=1 notice={voice} reason={error}" ); } } } } }