aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/mission_overlay.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-03 17:14:49 +0300
committerValentin Popov <valentin@popov.link>2026-12-03 17:14:49 +0300
commit1776dd8007169ef4f04969f0a5edcc423b6d67bc (patch)
treed6bf261f4ecf07ddb79026130448f5aa937d49a1 /apps/fparkan-game/src/mission_overlay.rs
parentca66e64b3995229ca7c8771b75ca26a60c3e344f (diff)
downloadfparkan-1776dd8007169ef4f04969f0a5edcc423b6d67bc.tar.xz
fparkan-1776dd8007169ef4f04969f0a5edcc423b6d67bc.zip
feat(ui): restore cockpit status indicators
Diffstat (limited to 'apps/fparkan-game/src/mission_overlay.rs')
-rw-r--r--apps/fparkan-game/src/mission_overlay.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/fparkan-game/src/mission_overlay.rs b/apps/fparkan-game/src/mission_overlay.rs
index fe646cc6..a2aafd4b 100644
--- a/apps/fparkan-game/src/mission_overlay.rs
+++ b/apps/fparkan-game/src/mission_overlay.rs
@@ -3,6 +3,7 @@ use super::{
cockpit_dial::CockpitDial,
cockpit_radar_hud::CockpitRadarHud,
cockpit_reticle::CockpitReticle,
+ cockpit_status_hud::CockpitStatusHud,
factory_menu::FactoryProjectPanel,
horizontal_fov, quad_indices,
satellite_map::SatelliteMap,
@@ -27,6 +28,7 @@ use super::{
use fparkan_assets::RgbaImage;
use fparkan_runtime::{
cockpit_altimeter::cockpit_altimeter,
+ cockpit_indicators::cockpit_indicators,
cockpit_speedometer::cockpit_speedometer,
radar::{cockpit_radar_period, cockpit_range_readout},
AutoDemoCamera, Engine, StartingCockpit,
@@ -51,6 +53,7 @@ pub(super) struct MissionOverlay {
#[cfg(windows)]
strategic_tooltip: Option<StrategicTooltipHud>,
dial: Option<CockpitDial>,
+ cockpit_status: Option<CockpitStatusHud>,
reticle: Option<CockpitReticle>,
#[cfg(windows)]
pub(super) instrument: Option<CockpitInstrument>,
@@ -94,6 +97,11 @@ impl MissionOverlay {
None
})
});
+ let cockpit_status = cockpit.and_then(|_| {
+ CockpitStatusHud::load(root, preview)
+ .inspect_err(|error| eprintln!("cockpit_status_unavailable reason={error}"))
+ .ok()
+ });
let reticle = cockpit.and_then(|_| {
CockpitReticle::load(root, preview)
.inspect_err(|error| eprintln!("cockpit_reticle_unavailable reason={error}"))
@@ -219,6 +227,7 @@ impl MissionOverlay {
#[cfg(windows)]
strategic_tooltip,
dial,
+ cockpit_status,
reticle,
#[cfg(windows)]
instrument,
@@ -233,6 +242,12 @@ impl MissionOverlay {
}
}
+ pub(super) fn note_exit_result(&mut self, clock_ms: u32, rejected: bool) {
+ if let Some(status) = &mut self.cockpit_status {
+ status.note_exit_result(clock_ms, rejected);
+ }
+ }
+
pub(super) fn remove_world_ranges(
&self,
ranges: &mut Vec<usize>,
@@ -268,6 +283,11 @@ impl MissionOverlay {
remove(range, ranges, counts);
}
}
+ if let Some(status) = &self.cockpit_status {
+ for range in status.ranges() {
+ remove(range, ranges, counts);
+ }
+ }
#[cfg(windows)]
if let Some(balance) = &self.strategy_balance {
remove(balance.range_index(), ranges, counts);
@@ -537,6 +557,10 @@ impl StaticVulkanApp {
speed,
)?;
}
+ if let Some(status) = &self.overlay.cockpit_status {
+ let state = occupant.and_then(|(engine, cockpit)| cockpit_indicators(engine, cockpit));
+ status.draw(renderer, &mut self.mesh, state, frame.clock.time_ms)?;
+ }
if let Some(radar) = &mut self.overlay.radar {
let period =
occupant.and_then(|(engine, cockpit)| cockpit_radar_period(engine, cockpit));