From e50b53e7a08d8b5e3393e477b890da95c4c8ef2a Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 08:50:33 +0400 Subject: feat(ui): install turrets and weapons in designer sockets Read the chassis and turret mount families from MSH Res10 and the attached devices from CTLD. Preserve the parent and mount node in Unit DAT, including separate ammunition subtrees for matching weapons. Verified from the stock Field Camp start: install a turret, mount two identical guns, remove one with its ammunition, and order the edited project through the factory panel. --- apps/fparkan-game/src/designer_projects.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'apps/fparkan-game/src/designer_projects.rs') diff --git a/apps/fparkan-game/src/designer_projects.rs b/apps/fparkan-game/src/designer_projects.rs index 45f5408a..b7335803 100644 --- a/apps/fparkan-game/src/designer_projects.rs +++ b/apps/fparkan-game/src/designer_projects.rs @@ -1,5 +1,6 @@ //! The original designer's named Unit DAT files under the game root. +use fparkan_assets::designer_screen::{designer_sockets, DesignerSocket}; use fparkan_prototype::UnitDat; use fparkan_runtime::{ edit_factory_project, inspect_saved_factory_project, is_saved_factory_project_name, @@ -32,6 +33,7 @@ pub(super) struct PreparedProjectModel { pub(super) project: UnitDat, pub(super) bytes: Arc<[u8]>, pub(super) geometry: super::designer_geometry::DesignerGeometry, + pub(super) sockets: Vec, } impl PreparedProjectModel { @@ -43,10 +45,12 @@ impl PreparedProjectModel { let assets = prepare_saved_factory_preview(engine, &project, bytes.clone()) .map_err(|error| error.to_string())?; let geometry = super::designer_geometry::DesignerGeometry::prepare(&project, &assets)?; + let sockets = designer_sockets(&assets, 0, &project.records); Ok(Self { project, bytes, geometry, + sockets, }) } -- cgit v1.2.3