From 6c2545e8b548a8b892ef2a3adaba1a138ab623c9 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 05:39:32 +0400 Subject: feat(ui): select and order factory projects in the mission --- apps/fparkan-game/src/mission_overlay.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'apps/fparkan-game/src/mission_overlay.rs') diff --git a/apps/fparkan-game/src/mission_overlay.rs b/apps/fparkan-game/src/mission_overlay.rs index e692e5b5..d6c0a242 100644 --- a/apps/fparkan-game/src/mission_overlay.rs +++ b/apps/fparkan-game/src/mission_overlay.rs @@ -1,6 +1,7 @@ use super::{ - cockpit_dial::CockpitDial, cockpit_radar_hud::CockpitRadarHud, horizontal_fov, - satellite_map::SatelliteMap, StaticPreviewScene, StaticVulkanApp, + cockpit_dial::CockpitDial, cockpit_radar_hud::CockpitRadarHud, + factory_menu::FactoryProjectPanel, horizontal_fov, satellite_map::SatelliteMap, + StaticPreviewScene, StaticVulkanApp, }; #[cfg(windows)] use super::{mission_help::MissionHelp, mission_hints::MissionHints, weapon_hud::WeaponHud}; @@ -17,6 +18,7 @@ pub(super) use fparkan_assets::ui_sprite::source_over; pub(super) struct MissionOverlay { pub(super) satellite_map: Option, dial: Option, + factory_projects: Option, pub(super) radar: Option, #[cfg(windows)] pub(super) hints: Option, @@ -85,11 +87,20 @@ impl MissionOverlay { None }) }); + let factory_projects = cockpit.and_then(|_| { + FactoryProjectPanel::load(root, preview) + .map(Some) + .unwrap_or_else(|error| { + eprintln!("factory_project_panel_unavailable reason={error}"); + None + }) + }); #[cfg(not(windows))] let _ = weapon_rows; Self { satellite_map, dial, + factory_projects, radar, #[cfg(windows)] hints, @@ -126,6 +137,9 @@ impl MissionOverlay { remove(range, ranges, counts); } } + if let Some(panel) = &self.factory_projects { + remove(panel.range_index(), ranges, counts); + } #[cfg(windows)] if let Some(hints) = &self.hints { remove(hints.range_index(), ranges, counts); @@ -215,6 +229,9 @@ impl StaticVulkanApp { if let Some(help) = &mut self.overlay.help { help.draw(renderer, &mut self.mesh, frame.viewport)?; } + if let Some(panel) = &mut self.overlay.factory_projects { + panel.draw(renderer, self.factory_menu.as_mut())?; + } Ok(()) } } -- cgit v1.2.3