From 1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 19:57:36 +0400 Subject: 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. --- crates/fparkan-runtime/src/player_weapon.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'crates/fparkan-runtime/src/player_weapon.rs') diff --git a/crates/fparkan-runtime/src/player_weapon.rs b/crates/fparkan-runtime/src/player_weapon.rs index 84408c61..4cc35fcc 100644 --- a/crates/fparkan-runtime/src/player_weapon.rs +++ b/crates/fparkan-runtime/src/player_weapon.rs @@ -719,11 +719,19 @@ fn firing_effect_row<'a>( } pub(super) fn prepare_unit_weapons(controls: &[Option]) -> PlayerWeapons { - PlayerWeapons { - weapons: controls + prepare_component_weapons( + controls .iter() .enumerate() - .filter_map(|(index, control)| Some((index, control.as_ref()?))) + .filter_map(|(index, control)| Some((index, control.as_ref()?))), + ) +} + +pub(super) fn prepare_component_weapons<'a>( + controls: impl Iterator, +) -> PlayerWeapons { + PlayerWeapons { + weapons: controls .flat_map(|(index, control)| prepare_weapons(index, control)) .collect(), ..PlayerWeapons::default() -- cgit v1.2.3