From dcba82d1cdf4a70ab879d8af0a623a10deecb544 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 08:00:08 +0400 Subject: feat(factory): build newly loaded projects without restarting the mission Transfer a saved design from the original designer panel, prepare it with the regular AniMesh scene builder, and queue the selected factory order. Appended world batches keep existing draw handles and gain the normal cockpit, walking animation, weapon and shield bindings. The Field Camp window witness adds a one-gun Unit DAT after mission start, uses the normal transfer and order controls, supplies the factory with a scripted test fixture, and captures the released unit with Vulkan validation clean. The two licensed factory tests also verify the assembled component records and weapon control. --- apps/fparkan-game/src/robot_designer.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'apps/fparkan-game/src/robot_designer.rs') diff --git a/apps/fparkan-game/src/robot_designer.rs b/apps/fparkan-game/src/robot_designer.rs index 26436d94..2d1be0d0 100644 --- a/apps/fparkan-game/src/robot_designer.rs +++ b/apps/fparkan-game/src/robot_designer.rs @@ -10,6 +10,7 @@ use fparkan_assets::designer_screen::{ use fparkan_platform_winit::text::StringResources; use fparkan_runtime::{factory_design_parts, factory_project_components, Engine}; use std::{ + collections::HashMap, path::Path, sync::{Arc, Weak}, }; @@ -18,6 +19,7 @@ pub(super) struct RobotDesignerPanel { assets: DesignerScreen, background: EnvironmentGpuRange, models: DesignerModels, + live_models: HashMap>, uploaded: Option<(Weak, DesignerModel)>, range: EnvironmentGpuRange, } @@ -56,6 +58,7 @@ impl RobotDesignerPanel { assets, background, models, + live_models: HashMap::new(), uploaded: None, range, }) @@ -67,6 +70,15 @@ impl RobotDesignerPanel { .chain(self.models.ranges()) } + pub(super) fn remember_live_model( + &mut self, + scheme: usize, + project: Arc, + ) { + self.live_models.entry(scheme).or_insert(project); + self.uploaded = None; + } + pub(super) fn draw( &mut self, renderer: &mut VulkanSmokeRenderer, @@ -87,7 +99,10 @@ impl RobotDesignerPanel { if let Some((project, elapsed)) = menu.as_ref().and_then(|menu| { let designer = menu.designer.as_ref()?; Some(( - designer.preview_project.as_ref()?, + designer.preview_project.as_ref().or_else(|| { + self.live_models + .get(&designer.active_scheme(&menu.choices)?) + })?, clock_ms.saturating_sub(designer.model_started_ms), )) }) { @@ -171,7 +186,7 @@ impl RobotDesignerPanel { hover: designer.hover, file_dialog, file_status: designer.file_status.as_deref(), - buildable: buildable.is_some(), + buildable: buildable.is_some() || designer.preview_project.is_some(), })?; renderer .update_material_texture( -- cgit v1.2.3