From 3b5a8aa4e6465ca56763cb96b4100bb1ff1c0ccf Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 18:50:37 +0400 Subject: feat(ui): link the other buildings panel to the satellite map Use the installed compound controls, font, and class glyphs for live clan buildings and their durability. Compare the stock Two Fortresses list order, first selection, two-way map selection, and close behavior in the original and in FParkan with Vulkan validation. --- apps/fparkan-game/src/mission_overlay.rs | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 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 406cf92c..43177b6a 100644 --- a/apps/fparkan-game/src/mission_overlay.rs +++ b/apps/fparkan-game/src/mission_overlay.rs @@ -14,9 +14,9 @@ use super::{ #[cfg(windows)] use super::{ mission_help::MissionHelp, mission_hints::MissionHints, - strategic_balance_hud::StrategicBalanceHud, strategic_factory_hud::StrategicFactoryHud, - strategic_roster_hud::StrategicRosterHud, strategic_tooltip_hud::StrategicTooltipHud, - weapon_hud::WeaponHud, + strategic_balance_hud::StrategicBalanceHud, strategic_buildings_hud::StrategicBuildingsHud, + strategic_factory_hud::StrategicFactoryHud, strategic_roster_hud::StrategicRosterHud, + strategic_tooltip_hud::StrategicTooltipHud, weapon_hud::WeaponHud, }; use fparkan_assets::RgbaImage; use fparkan_runtime::{ @@ -40,6 +40,8 @@ pub(super) struct MissionOverlay { #[cfg(windows)] pub(super) strategic_factory: Option, #[cfg(windows)] + pub(super) strategic_buildings: Option, + #[cfg(windows)] strategic_tooltip: Option, dial: Option, pub(super) factory_projects: Option, @@ -130,6 +132,12 @@ impl MissionOverlay { .ok() }); #[cfg(windows)] + let strategic_buildings = cockpit.and_then(|_| { + StrategicBuildingsHud::load(root, preview) + .inspect_err(|error| eprintln!("strategic_buildings_unavailable reason={error}")) + .ok() + }); + #[cfg(windows)] let weapons = cockpit.and_then(|cockpit| { WeaponHud::load(root, cockpit.handle, preview) .map(Some) @@ -186,6 +194,8 @@ impl MissionOverlay { #[cfg(windows)] strategic_factory, #[cfg(windows)] + strategic_buildings, + #[cfg(windows)] strategic_tooltip, dial, factory_projects, @@ -236,6 +246,10 @@ impl MissionOverlay { remove(factory.range_index(), ranges, counts); } #[cfg(windows)] + if let Some(buildings) = &self.strategic_buildings { + remove(buildings.range_index(), ranges, counts); + } + #[cfg(windows)] if let Some(tooltip) = &self.strategic_tooltip { remove(tooltip.range_index(), ranges, counts); } @@ -289,6 +303,8 @@ impl StaticVulkanApp { #[cfg(windows)] let warbot_rows = self.strategic_warbot_rows(); #[cfg(windows)] + let buildings_frame = self.strategic_buildings_frame(); + #[cfg(windows)] let row_count = warbot_rows.len(); #[cfg(windows)] let cursor = self.strategy_cursor(row_count); @@ -312,6 +328,7 @@ impl StaticVulkanApp { sections: fparkan_runtime::strategic_toolbar::available_sections(engine, cockpit), warbots_open: view.warbots_open, factories_open: view.factories_open(), + other_buildings_open: view.other_buildings_open(), map_open: self .overlay .satellite_map @@ -338,6 +355,10 @@ impl StaticVulkanApp { .as_ref() .and_then(|view| view.selected_warbot); #[cfg(windows)] + if let Some(buildings) = &mut self.overlay.strategic_buildings { + buildings.draw(renderer, buildings_frame)?; + } + #[cfg(windows)] if let Some(roster) = &mut self.overlay.strategic_roster { let card = selected_warbot .zip(self.mission_engine.as_ref()) @@ -387,6 +408,7 @@ impl StaticVulkanApp { demo_target .map(|target| target.handle) .or(selected_warbot) + .or_else(|| self.command_view.as_ref()?.selected_building()) .or_else(|| { fparkan_runtime::player_vehicle(engine) .map(|vehicle| vehicle.handle) -- cgit v1.2.3