From 7dd027fd5130daf532cd2214a6d9689293bb2c86 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 13:07:11 +0400 Subject: feat(ui): assign search and destroy from the warbot panel Show the native search status immediately without opening the map. Verify from the stock Two Fortresses start that the selected marker moves with the internal route hidden and that Stand cancels the search. --- crates/fparkan-assets/src/strategic_roster.rs | 2 +- crates/fparkan-assets/src/strategic_roster/orders.rs | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'crates/fparkan-assets/src') diff --git a/crates/fparkan-assets/src/strategic_roster.rs b/crates/fparkan-assets/src/strategic_roster.rs index b41e4102..c94281cc 100644 --- a/crates/fparkan-assets/src/strategic_roster.rs +++ b/crates/fparkan-assets/src/strategic_roster.rs @@ -173,7 +173,7 @@ impl RosterImages { &self, rows: &[Row<'_>], card: &[Option>], - orders: Option<([&str; 4], Option)>, + orders: Option<([&str; 5], Option)>, ) -> Result { let mut panel = self.background.clone(); if let Some(row) = rows.iter().find(|row| row.selected) { diff --git a/crates/fparkan-assets/src/strategic_roster/orders.rs b/crates/fparkan-assets/src/strategic_roster/orders.rs index 6e6e1e22..d4a6a9ec 100644 --- a/crates/fparkan-assets/src/strategic_roster/orders.rs +++ b/crates/fparkan-assets/src/strategic_roster/orders.rs @@ -12,13 +12,16 @@ pub enum RosterOrder { Stand, /// Draw a route and send it to the unit. FollowRoute, + /// Find and engage hostile mobile units. + SearchAndDestroy, /// Patrol a point or a live object. Patrol, } -const ORDERS: [RosterOrder; 3] = [ +const ORDERS: [RosterOrder; 4] = [ RosterOrder::Stand, RosterOrder::FollowRoute, + RosterOrder::SearchAndDestroy, RosterOrder::Patrol, ]; @@ -27,6 +30,7 @@ impl RosterOrder { match self { Self::Stand => 0, Self::FollowRoute => 1, + Self::SearchAndDestroy => 2, Self::Patrol => 3, } } @@ -81,7 +85,7 @@ impl OrderImages { roster: &RosterImages, panel: &mut RgbaImage, count: usize, - [title, stand, follow, patrol]: [&str; 4], + [title, stand, follow, search, patrol]: [&str; 5], hovered: Option, ) -> Result<(), String> { let x = LEFT - ORIGIN[0]; @@ -121,7 +125,7 @@ impl OrderImages { [128; 3], ); } - for (order, label) in ORDERS.into_iter().zip([stand, follow, patrol]) { + for (order, label) in ORDERS.into_iter().zip([stand, follow, search, patrol]) { let y = y + (order.slot() + 1) * ROW_PITCH; let bottom = y + ROW_HEIGHT; let label = roster.font.centered_line(label, 247, ROW_HEIGHT as u16)?; @@ -162,7 +166,10 @@ mod tests { assert_eq!(order_at([250.0, 217.0], 3), None); assert_eq!(order_at([250.0, 218.0], 3), Some(RosterOrder::FollowRoute)); assert_eq!(order_at([250.0, 218.0], 4), Some(RosterOrder::Stand)); - assert_eq!(order_at([250.0, 238.0], 3), None); + assert_eq!( + order_at([250.0, 238.0], 3), + Some(RosterOrder::SearchAndDestroy) + ); assert_eq!(order_at([250.0, 258.0], 3), Some(RosterOrder::Patrol)); } } -- cgit v1.2.3