aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-assets/src/strategy_cursor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-assets/src/strategy_cursor.rs')
-rw-r--r--crates/fparkan-assets/src/strategy_cursor.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/fparkan-assets/src/strategy_cursor.rs b/crates/fparkan-assets/src/strategy_cursor.rs
index 392fa894..c38a5bc9 100644
--- a/crates/fparkan-assets/src/strategy_cursor.rs
+++ b/crates/fparkan-assets/src/strategy_cursor.rs
@@ -15,17 +15,20 @@ pub enum StrategyCursor {
Place,
/// An invalid order waypoint.
WrongPlace,
+ /// An eligible patrol point or object.
+ Guard,
}
impl StrategyCursor {
/// Modes in draw-range order.
- pub const ALL: [Self; 3] = [Self::Arrow, Self::Place, Self::WrongPlace];
+ pub const ALL: [Self; 4] = [Self::Arrow, Self::Place, Self::WrongPlace, Self::Guard];
fn key(self) -> &'static str {
match self {
Self::Arrow => "ARROW",
Self::Place => "PLACE",
Self::WrongPlace => "WRONG_PLACE",
+ Self::Guard => "GUARD",
}
}
}
@@ -38,7 +41,7 @@ pub struct CursorStrip {
}
/// Loads the route cursor strips from the installed UI archive.
-pub fn load(vfs: &dyn Vfs) -> Result<[CursorStrip; 3], String> {
+pub fn load(vfs: &dyn Vfs) -> Result<[CursorStrip; StrategyCursor::ALL.len()], String> {
let config = ui_configuration::read(vfs, "ui/cursor.cfg")?;
let config = String::from_utf8_lossy(&config);
let region = |kind: StrategyCursor| {
@@ -85,7 +88,7 @@ mod tests {
let strips = load(&DirectoryVfs::new(root)).unwrap();
assert_eq!(
strips.each_ref().map(|strip| strip.hotspot),
- [[0, 0], [8, 8], [8, 8]]
+ [[0, 0], [8, 8], [8, 8], [8, 8]]
);
for strip in strips {
assert_eq!([strip.image.width, strip.image.height], [64, 16]);