From 61208d874cb3d9bf93e9f7c60aceebc287454b62 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 11:59:08 +0400 Subject: feat(ui): give warbots standing and route orders Bind the first two commands to the live selection and shared route controller. Build the order panel from the installed compound controls and game font. In stock Two Fortresses, checked Stand, route drafting on the satellite map and terrain, and movement after confirmation with Vulkan validation. --- crates/fparkan-runtime/src/unit_patrol.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/fparkan-runtime/src/unit_patrol.rs') diff --git a/crates/fparkan-runtime/src/unit_patrol.rs b/crates/fparkan-runtime/src/unit_patrol.rs index 44e83986..4f708af3 100644 --- a/crates/fparkan-runtime/src/unit_patrol.rs +++ b/crates/fparkan-runtime/src/unit_patrol.rs @@ -32,6 +32,7 @@ pub(super) struct UnitPatrol { animal_migration: Vec, migration_rng: u32, shut_down: HashSet, + standing: HashSet, script_orders: Vec<(ObjectHandle, VecDeque)>, script_order_counts: BTreeMap<(u32, u32), u64>, clock_ms: u32, @@ -168,6 +169,7 @@ impl UnitPatrol { animal_migration: Vec::new(), migration_rng: 1, shut_down: HashSet::new(), + standing: HashSet::new(), script_orders: Vec::new(), script_order_counts: BTreeMap::new(), clock_ms: 0, @@ -189,6 +191,7 @@ impl UnitPatrol { ) -> bool { self.script_orders.retain(|(unit, _)| *unit != handle); self.shut_down.remove(&handle); + self.standing.remove(&handle); self.units .retain(|unit| transform_state(world, unit.handle).is_ok()); if let Some(unit) = self.units.iter_mut().find(|unit| unit.handle == handle) { @@ -365,6 +368,7 @@ impl UnitPatrol { pub(super) fn shut_down(&mut self, handle: ObjectHandle) -> bool { self.script_orders.retain(|(unit, _)| *unit != handle); + self.standing.remove(&handle); // shortcut: stop autonomous movement and fire until the native shutdown task is modeled. self.units.retain(|unit| unit.handle != handle); self.shut_down.insert(handle) @@ -498,6 +502,7 @@ impl UnitPatrol { animal_migration: Vec::new(), migration_rng: 1, shut_down: HashSet::new(), + standing: HashSet::new(), script_orders: Vec::new(), script_order_counts: BTreeMap::new(), clock_ms: 0, -- cgit v1.2.3