From 0b0764de47a0a1fef30464fb5e4be496e101b083 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 12:28:48 +0400 Subject: feat(ui): assign patrols from the strategic warbot panel Use the installed order string and GUARD cursor. A single valid click assigns a 300-unit patrol around a terrain point or a live object. Checked the terrain and satellite paths, rejected terrain, and cancellation in the stock Two Fortresses window. --- apps/fparkan-game/src/strategy_cursor_hud.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'apps/fparkan-game/src/strategy_cursor_hud.rs') diff --git a/apps/fparkan-game/src/strategy_cursor_hud.rs b/apps/fparkan-game/src/strategy_cursor_hud.rs index d64217a5..1f13ba84 100644 --- a/apps/fparkan-game/src/strategy_cursor_hud.rs +++ b/apps/fparkan-game/src/strategy_cursor_hud.rs @@ -7,7 +7,7 @@ use std::path::Path; use winit::window::Window; pub(super) struct StrategyCursorHud { - strips: [CursorDraw; 3], + strips: [CursorDraw; StrategyCursor::ALL.len()], visible: bool, } @@ -22,7 +22,7 @@ struct CursorDraw { impl StrategyCursorHud { pub(super) fn load(root: &Path, preview: &mut StaticPreviewScene) -> Result { - let [arrow, place, wrong_place] = strategy_cursor::load(&DirectoryVfs::new(root))?; + let [arrow, place, wrong_place, guard] = strategy_cursor::load(&DirectoryVfs::new(root))?; let mut load = |strip: CursorStrip| { let size = [ (strip.image.width / PHASES) as f32, @@ -44,12 +44,12 @@ impl StrategyCursorHud { }) }; Ok(Self { - strips: [load(arrow)?, load(place)?, load(wrong_place)?], + strips: [load(arrow)?, load(place)?, load(wrong_place)?, load(guard)?], visible: false, }) } - pub(super) fn ranges(&self) -> [usize; 3] { + pub(super) fn ranges(&self) -> [usize; StrategyCursor::ALL.len()] { std::array::from_fn(|i| self.strips[i].range.range_index) } -- cgit v1.2.3