aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-assets/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-assets/src')
-rw-r--r--crates/fparkan-assets/src/strategic_roster.rs2
-rw-r--r--crates/fparkan-assets/src/strategic_roster/orders.rs15
2 files changed, 12 insertions, 5 deletions
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<CardLine<'_>>],
- orders: Option<([&str; 4], Option<RosterOrder>)>,
+ orders: Option<([&str; 5], Option<RosterOrder>)>,
) -> Result<RgbaImage, String> {
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<RosterOrder>,
) -> 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));
}
}