diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 11:48:50 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 11:48:50 +0300 |
| commit | dc92ae05f97d84a1681995e0712b01053e48704c (patch) | |
| tree | c8e203ea9dda6abf0a85241135504a4bf99840df /apps/fparkan-game/src/strategic_view.rs | |
| parent | 0b0764de47a0a1fef30464fb5e4be496e101b083 (diff) | |
| download | fparkan-dc92ae05f97d84a1681995e0712b01053e48704c.tar.xz fparkan-dc92ae05f97d84a1681995e0712b01053e48704c.zip | |
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.
Diffstat (limited to 'apps/fparkan-game/src/strategic_view.rs')
| -rw-r--r-- | apps/fparkan-game/src/strategic_view.rs | 34 |
1 files changed, 27 insertions, 7 deletions
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 @@ -53,6 +53,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<Option<RosterOrder>> { rows.iter() .any(|row| Some(row.handle) == self.selected_warbot && row.selectable) @@ -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<WarbotRow> { 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) -} |
