aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/mission_overlay.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-02 04:39:32 +0300
committerValentin Popov <valentin@popov.link>2026-12-02 04:39:32 +0300
commit6c2545e8b548a8b892ef2a3adaba1a138ab623c9 (patch)
tree4e1a9926db1fbb566db5e4a84065b5570a951aaa /apps/fparkan-game/src/mission_overlay.rs
parentcd45231dd2a4fd9f970d9c7e06004cedd5c9add6 (diff)
downloadfparkan-6c2545e8b548a8b892ef2a3adaba1a138ab623c9.tar.xz
fparkan-6c2545e8b548a8b892ef2a3adaba1a138ab623c9.zip
feat(ui): select and order factory projects in the mission
Diffstat (limited to 'apps/fparkan-game/src/mission_overlay.rs')
-rw-r--r--apps/fparkan-game/src/mission_overlay.rs21
1 files changed, 19 insertions, 2 deletions
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<SatelliteMap>,
dial: Option<CockpitDial>,
+ factory_projects: Option<FactoryProjectPanel>,
pub(super) radar: Option<CockpitRadarHud>,
#[cfg(windows)]
pub(super) hints: Option<MissionHints>,
@@ -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(())
}
}