diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 07:50:33 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 07:50:33 +0300 |
| commit | e50b53e7a08d8b5e3393e477b890da95c4c8ef2a (patch) | |
| tree | 1506b2d9685b562b4b22966c5e16bc574f69fbbc /apps/fparkan-game/src/designer_projects.rs | |
| parent | 20491de7c29f56fda9be16d3b56a9633cb71d386 (diff) | |
| download | fparkan-e50b53e7a08d8b5e3393e477b890da95c4c8ef2a.tar.xz fparkan-e50b53e7a08d8b5e3393e477b890da95c4c8ef2a.zip | |
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.
Diffstat (limited to 'apps/fparkan-game/src/designer_projects.rs')
| -rw-r--r-- | apps/fparkan-game/src/designer_projects.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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<DesignerSocket>, } 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, }) } |
