diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 07:36:47 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 07:36:47 +0300 |
| commit | 20491de7c29f56fda9be16d3b56a9633cb71d386 (patch) | |
| tree | 9505e9e89e542e7e8fdebfb5d3e334cef205cf3a /crates/fparkan-runtime/src/production.rs | |
| parent | 2f5791c59692beda3c948d3f9efd6557a32f4913 (diff) | |
| download | fparkan-20491de7c29f56fda9be16d3b56a9633cb71d386.tar.xz fparkan-20491de7c29f56fda9be16d3b56a9633cb71d386.zip | |
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.
Diffstat (limited to 'crates/fparkan-runtime/src/production.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/production.rs | 6 |
1 files changed, 2 insertions, 4 deletions
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<Vec<String>, 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<T>( +pub(super) fn with_clan_research<T>( vfs: &Option<Arc<dyn Vfs>>, mission: &LoadedMissionState, owner: OwnerId, |
