aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/strategy_cursor_hud.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-02 11:28:48 +0300
committerValentin Popov <valentin@popov.link>2026-12-02 11:28:48 +0300
commit0b0764de47a0a1fef30464fb5e4be496e101b083 (patch)
tree91d129a508a0e2fdbedfdeadf7b9fa5bbd0f1a2e /apps/fparkan-game/src/strategy_cursor_hud.rs
parent733f9d92e0d4e40ed40db42fa6cd11294e49eb7b (diff)
downloadfparkan-0b0764de47a0a1fef30464fb5e4be496e101b083.tar.xz
fparkan-0b0764de47a0a1fef30464fb5e4be496e101b083.zip
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.
Diffstat (limited to 'apps/fparkan-game/src/strategy_cursor_hud.rs')
-rw-r--r--apps/fparkan-game/src/strategy_cursor_hud.rs8
1 files changed, 4 insertions, 4 deletions
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<Self, String> {
- 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)
}