From 6954eb74b535341bed234091e67f62ed13266c25 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Tue, 1 Dec 2026 22:20:20 +0400 Subject: feat(ui): open the authored mission satellite map Read the minimap archive binding from mission.cfg and resolve the compass through the original UI atlas key and crop. M toggles the overlay and Ctrl+M retains the current mine command. Checked show/hide in the Constructor window and the original DLL. --- apps/fparkan-game/src/main.rs | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'apps/fparkan-game/src/main.rs') diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index cd6ce717..328aff46 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -20,6 +20,7 @@ mod mission_notices; mod mission_pause; mod motion_effects; mod player_collision; +mod satellite_map; #[cfg(test)] use fparkan_runtime::query_building_segment_world; #[cfg(test)] @@ -9592,6 +9593,14 @@ fn run_static_vulkan_mode( } else { None }; + let satellite_map = if mission_engine.is_some() && demo_camera.is_none() { + satellite_map::SatelliteMap::load(root, mission, &mut preview).unwrap_or_else(|error| { + eprintln!("satellite_map_unavailable mission={mission} reason={error}"); + None + }) + } else { + None + }; let cockpit_geometry = mission_engine .as_ref() .map(|engine| cockpit_geometry::CockpitGeometry::prepare(engine, &mut preview)) @@ -9631,6 +9640,13 @@ fn run_static_vulkan_mode( .retain(|index| app.world_range_index_counts.contains_key(index)); } app.shield_effects = shield_effects; + if let Some(map) = &satellite_map { + for range in map.ranges() { + app.world_range_indices.retain(|&index| index != range); + app.world_range_index_counts.remove(&range); + } + } + app.satellite_map = satellite_map; #[cfg(windows)] { if let Some(hints) = &mission_hints { @@ -9864,6 +9880,7 @@ struct StaticVulkanApp { mission_title: String, #[cfg(windows)] mission_hints: Option, + satellite_map: Option, audio: Option, camera_mode: &'static str, mesh_components: usize, @@ -10034,6 +10051,7 @@ impl StaticVulkanApp { mission_title: String::new(), #[cfg(windows)] mission_hints: None, + satellite_map: None, audio, camera_mode: preview.camera_mode, mesh_components: preview.mesh_components, @@ -11648,6 +11666,9 @@ impl StaticVulkanApp { let Some(renderer) = self.renderer.as_mut() else { return Ok(()); }; + if let Some(map) = &self.satellite_map { + map.draw(renderer, &mut self.mesh, frame.viewport)?; + } #[cfg(windows)] if let Some(hints) = &mut self.mission_hints { hints.draw( @@ -12453,7 +12474,13 @@ impl ApplicationHandler for StaticVulkanApp { self.player_service_pressed = true; } if self.demo_camera.is_none() && code == KeyCode::KeyM { - self.player_mine_pressed = true; + if self.pressed_keys.contains(&KeyCode::ControlLeft) + || self.pressed_keys.contains(&KeyCode::ControlRight) + { + self.player_mine_pressed = true; + } else if let Some(map) = &mut self.satellite_map { + map.toggle(); + } } if let Some(slot) = [ KeyCode::Digit0, -- cgit v1.2.3