From 733f9d92e0d4e40ed40db42fa6cd11294e49eb7b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 12:12:06 +0400 Subject: feat(ui): show native strategic waypoint cursors Read the animated cursor strips and their hotspots from the installed UI atlas. Use the native Land.map areal flag and chassis selector for both the preview cursor and waypoint input. In stock Two Fortresses, compared one accepted and one rejected map point against the original and checked the return to the cockpit with Vulkan validation. --- apps/fparkan-game/src/mission_overlay.rs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 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 8825094b..66a40697 100644 --- a/apps/fparkan-game/src/mission_overlay.rs +++ b/apps/fparkan-game/src/mission_overlay.rs @@ -2,8 +2,9 @@ use super::{ append_environment_gradient_material, append_environment_range, cockpit_dial::CockpitDial, cockpit_radar_hud::CockpitRadarHud, factory_menu::FactoryProjectPanel, horizontal_fov, quad_indices, satellite_map::SatelliteMap, screen_tl_quad_vertices_pixels, - world_pipeline_state, DirectoryVfs, EnvironmentGpuRange, LegacyBlendMode, LegacyDepthMode, - StaticPreviewScene, StaticVulkanApp, VulkanStaticTexture, + strategy_cursor_hud::StrategyCursorHud, world_pipeline_state, DirectoryVfs, + EnvironmentGpuRange, LegacyBlendMode, LegacyDepthMode, StaticPreviewScene, StaticVulkanApp, + VulkanStaticTexture, }; #[cfg(windows)] use super::{ @@ -25,6 +26,7 @@ pub(super) use fparkan_assets::ui_sprite::source_over; pub(super) struct MissionOverlay { pub(super) satellite_map: Option, strategy_toolbar: Option, + pub(super) strategy_cursor: Option, #[cfg(windows)] strategy_balance: Option, #[cfg(windows)] @@ -146,9 +148,15 @@ impl MissionOverlay { None }) }); + let strategy_cursor = cockpit.and_then(|_| { + StrategyCursorHud::load(root, preview) + .inspect_err(|error| eprintln!("strategy_cursor_unavailable reason={error}")) + .ok() + }); Self { satellite_map, strategy_toolbar, + strategy_cursor, #[cfg(windows)] strategy_balance, #[cfg(windows)] @@ -184,6 +192,11 @@ impl MissionOverlay { if let Some(toolbar) = self.strategy_toolbar { remove(toolbar.range_index, ranges, counts); } + if let Some(cursor) = &self.strategy_cursor { + for range in cursor.ranges() { + remove(range, ranges, counts); + } + } #[cfg(windows)] if let Some(balance) = &self.strategy_balance { remove(balance.range_index(), ranges, counts); @@ -226,6 +239,10 @@ impl StaticVulkanApp { pub(super) fn draw_mission_overlay(&mut self) -> Result<(), String> { #[cfg(windows)] let warbot_rows = self.strategic_warbot_rows(); + #[cfg(windows)] + let cursor = self.strategy_cursor(warbot_rows.len()); + #[cfg(not(windows))] + let cursor = self.strategy_cursor(0); let (Some(renderer), Some(frame)) = (&mut self.renderer, &self.pending_scene_update) else { return Ok(()); }; @@ -372,6 +389,12 @@ impl StaticVulkanApp { frame.clock.time_ms, )?; } + if let Some(hud) = &mut self.overlay.strategy_cursor { + if let Some(window) = &self.window { + hud.sync_visibility(window, cursor.is_some(), self.mouse_look); + } + hud.draw(renderer, &mut self.mesh, frame.clock.time_ms, cursor)?; + } Ok(()) } } -- cgit v1.2.3