From 20491de7c29f56fda9be16d3b56a9633cb71d386 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 08:36:47 +0400 Subject: feat(ui): build factory projects from a selected chassis Use researched chassis that fit the selected factory and populate a new Unit DAT from the chassis Control slots and stock default parts. The designer can remove the old chassis, preview the new model, edit its internal parts, and transfer it to the factory. Verified the stock start of Field Camp: remove S-12w, select S-31, install another battery, and queue the resulting project with Vulkan validation enabled. --- crates/fparkan-runtime/src/production.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/fparkan-runtime/src/production.rs') diff --git a/crates/fparkan-runtime/src/production.rs b/crates/fparkan-runtime/src/production.rs index ff67b95b..f29cea25 100644 --- a/crates/fparkan-runtime/src/production.rs +++ b/crates/fparkan-runtime/src/production.rs @@ -462,13 +462,11 @@ pub fn factory_project_components( pub fn factory_part_variants( engine: &Engine, cockpit: StartingCockpit, - scheme: usize, + records: &[UnitComponentRecord], component: usize, ) -> Result, EngineError> { let (mission, _) = loaded_production(engine)?; let owner = player_owner(&engine.world, cockpit)?; - let records = factory_project_components(engine, scheme) - .ok_or_else(|| production_error("unknown factory scheme"))?; with_clan_research(&engine.services.vfs, mission, owner, |research| { Ok(part_variants(records, component, research, |row| { mission.free_research.learned.contains(&(owner, row)) @@ -852,7 +850,7 @@ pub(super) fn clan_scheme_cost( }) } -fn with_clan_research( +pub(super) fn with_clan_research( vfs: &Option>, mission: &LoadedMissionState, owner: OwnerId, -- cgit v1.2.3