diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 18:57:36 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 18:57:36 +0300 |
| commit | 1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4 (patch) | |
| tree | 9ef8276c399e238a2a692862de09f54bf5dcee65 /crates/fparkan-runtime/src/boarding/remote_control.rs | |
| parent | 077bead07a76908ac4e0e2b84de3940256cf6fd1 (diff) | |
| download | fparkan-1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4.tar.xz fparkan-1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4.zip | |
feat(ui): enable manual control from the bunker list
Use the active Control camera record and its separate CPT origin and direction for the fixed turret. The original hand control opens the cockpit, its two weapon slots and aim tracks while leaving the operator at the command post.
Verified from the stock Two Fortresses start against the GOG cockpit with Vulkan validation. The licensed tests cover the native camera pose, mounted weapon selection and stationary bunker and operator.
Diffstat (limited to 'crates/fparkan-runtime/src/boarding/remote_control.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/boarding/remote_control.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/crates/fparkan-runtime/src/boarding/remote_control.rs b/crates/fparkan-runtime/src/boarding/remote_control.rs index ee030e2f..1a881a5d 100644 --- a/crates/fparkan-runtime/src/boarding/remote_control.rs +++ b/crates/fparkan-runtime/src/boarding/remote_control.rs @@ -1,6 +1,6 @@ //! The command-post link to a friendly warbot's cockpit. -use super::{has_working_pilot_control, start_warbot_control}; +use super::{has_working_pilot_control, start_player_control}; use crate::{ component_cockpit, strategic_roster::warbot_rows, @@ -76,14 +76,19 @@ pub fn control_warbot_remotely( { patrol.release_orders_for_manual_control(target); } - start_warbot_control(engine, hero, cockpit, Some(mode)); + start_player_control(engine, hero, cockpit, Some(mode), None); Some(cockpit) } /// The active control mode of a warbot linked to the command post. #[must_use] pub fn remote_warbot_control(engine: &Engine) -> Option<RemoteWarbotControl> { - engine.loaded.as_ref()?.boarding?.remote + let boarding = engine.loaded.as_ref()?.boarding?; + boarding + .turret + .is_none() + .then_some(boarding.remote) + .flatten() } /// The active autonomous weapons' ammunition, charge and firing phases. @@ -100,7 +105,7 @@ pub fn remote_automatic_weapons(engine: &Engine) -> Option<&PlayerWeapons> { } #[cfg(test)] -mod tests { +pub(super) mod tests { use super::*; use crate::{ create, disembark_warbot, frame, frame_with_player_motion, load_gameplay_mission, @@ -111,7 +116,7 @@ mod tests { use fparkan_world::transform_state; use std::sync::Arc; - fn stock_fortresses() -> Engine { + pub(in crate::boarding) fn stock_fortresses() -> Engine { let root = std::env::var_os("FPARKAN_CORPUS_PART1_ROOT").expect("licensed corpus"); let mut engine = create(EngineServices::new(Arc::new(DirectoryVfs::new(root)))).unwrap(); load_gameplay_mission( |
