diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 10:59:08 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 10:59:08 +0300 |
| commit | 61208d874cb3d9bf93e9f7c60aceebc287454b62 (patch) | |
| tree | e23585ccd89bfd73b36174742acc1777f569afa2 /crates/fparkan-runtime/src/unit_patrol.rs | |
| parent | 20161fbf4fab9080a2d0d6ceedbf1344435cfda0 (diff) | |
| download | fparkan-61208d874cb3d9bf93e9f7c60aceebc287454b62.tar.xz fparkan-61208d874cb3d9bf93e9f7c60aceebc287454b62.zip | |
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.
Diffstat (limited to 'crates/fparkan-runtime/src/unit_patrol.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/unit_patrol.rs | 5 |
1 files changed, 5 insertions, 0 deletions
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<AnimalMigration>, migration_rng: u32, shut_down: HashSet<ObjectHandle>, + standing: HashSet<ObjectHandle>, script_orders: Vec<(ObjectHandle, VecDeque<orders::UnitOrder>)>, 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, |
