From dc92ae05f97d84a1681995e0712b01053e48704c Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 12:48:50 +0400 Subject: feat(ui): show live contacts below the strategic satellite map Use the installed title, close control and contact glyphs. Display the hovered object with clan emblem, name, order and durability in the strategic layout. Compared the Captain and Small Warehouse readouts with the original and checked map closing and cockpit return in stock Two Fortresses. --- apps/fparkan-game/src/strategic_view.rs | 34 ++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'apps/fparkan-game/src/strategic_view.rs') diff --git a/apps/fparkan-game/src/strategic_view.rs b/apps/fparkan-game/src/strategic_view.rs index 3cecce16..b19de9d4 100644 --- a/apps/fparkan-game/src/strategic_view.rs +++ b/apps/fparkan-game/src/strategic_view.rs @@ -52,6 +52,11 @@ impl ActiveCommandView { } } + #[cfg(windows)] + pub(super) fn pointer(&self) -> Option<[f32; 2]> { + self.pointer + } + #[cfg(windows)] pub(super) fn order_panel(&self, rows: &[WarbotRow]) -> Option> { rows.iter() @@ -80,7 +85,7 @@ impl StaticVulkanApp { let kind = match view .order_input .as_ref() - .filter(|_| !over_strategy_controls(xy, rows)) + .filter(|_| !self.over_strategy_controls(xy, rows)) { Some(OrderInput::Route(_)) => { if self.pick_route_point(xy, view.selected_warbot).is_some() { @@ -281,13 +286,23 @@ impl StaticVulkanApp { let Some(xy) = view.pointer else { return; }; + if button == MouseButton::Left + && self + .overlay + .satellite_map + .as_mut() + .is_some_and(|map| map.close_command_at(xy)) + { + return; + } let rows = self .mission_engine .as_ref() .zip(self.cockpit) .filter(|_| button == MouseButton::Left && view.warbots_open) .map_or_else(Vec::new, |(engine, cockpit)| warbot_rows(engine, cockpit)); - let target = if button == MouseButton::Left && !over_strategy_controls(xy, rows.len()) { + let target = if button == MouseButton::Left && !self.over_strategy_controls(xy, rows.len()) + { match &view.order_input { Some(OrderInput::Route(_)) => self .pick_route_point(xy, view.selected_warbot) @@ -465,6 +480,16 @@ impl StaticVulkanApp { (hit.distance <= self.view_camera.far_plane).then_some(hit) } + fn over_strategy_controls(&self, xy: [f32; 2], rows: usize) -> bool { + (0.0..fparkan_assets::strategy_toolbar::EXTENT[0] as f32).contains(&xy[0]) + || covers_pointer(xy, rows) + || self + .overlay + .satellite_map + .as_ref() + .is_some_and(|map| map.chrome_at(xy)) + } + #[cfg(windows)] pub(super) fn strategic_warbot_rows(&mut self) -> Vec { let Some(view) = self.command_view.as_mut().filter(|view| view.warbots_open) else { @@ -479,8 +504,3 @@ impl StaticVulkanApp { rows } } - -fn over_strategy_controls(xy: [f32; 2], rows: usize) -> bool { - (0.0..fparkan_assets::strategy_toolbar::EXTENT[0] as f32).contains(&xy[0]) - || covers_pointer(xy, rows) -} -- cgit v1.2.3