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/hero_look.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'crates/fparkan-runtime/src/hero_look.rs') diff --git a/crates/fparkan-runtime/src/hero_look.rs b/crates/fparkan-runtime/src/hero_look.rs index d671f2b7..2e923d20 100644 --- a/crates/fparkan-runtime/src/hero_look.rs +++ b/crates/fparkan-runtime/src/hero_look.rs @@ -16,11 +16,19 @@ pub(super) struct HeroLook { impl HeroLook { pub(super) fn load(vfs: &dyn Vfs) -> Self { + Self::load_profile(vfs, b"hero.tbl", "CICLS_UNKNOWN", "MCMD_ANGLE_Z") + } + + pub(super) fn load_fixed_turret(vfs: &dyn Vfs) -> Self { + Self::load_profile(vfs, b"m1.tbl", "CICLS_TURRET", "MCMD_ANGLE_X") + } + + fn load_profile(vfs: &dyn Vfs, table_name: &[u8], yaw_class: &str, yaw_command: &str) -> Self { let read = |name: &[u8]| { let path = normalize_relative(name, PathPolicy::StrictLegacy).ok()?; vfs.read(&path).ok() }; - let table_bytes = read(b"hero.tbl"); + let table_bytes = read(table_name); let settings_bytes = read(b"Iron_3D.ini"); let table = String::from_utf8_lossy(table_bytes.as_deref().unwrap_or_default()); let settings = String::from_utf8_lossy(settings_bytes.as_deref().unwrap_or_default()); @@ -29,8 +37,8 @@ impl HeroLook { &table, "SCAN_NULL", "SCAN_MOUSE_X", - "CICLS_UNKNOWN", - "MCMD_ANGLE_Z", + yaw_class, + yaw_command, "MAN_WRAP", ) .unwrap_or(0.15), -- cgit v1.2.3