diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/WOLF/Patches/Konstruction.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/WOLF/Patches/Konstruction.cfg index 14c62a4a..713be4a4 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/WOLF/Patches/Konstruction.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/WOLF/Patches/Konstruction.cfg @@ -5,7 +5,7 @@ name = WOLF_RecipeOption RecipeDisplayName = #autoLOC_USI_WOLF_FABRICATOR_RECIPE_ALLOYS - InputResources = Maintenance,1,Metals,1,RareMetals,4,Power,1,TechnicianCrewPoint,1 + InputResources = Lab,1,Maintenance,1,Metals,1,RareMetals,4,Power,1,ScientistCrewPoint,1 OutputResources = Alloys,1 } MODULE @@ -13,7 +13,7 @@ name = WOLF_RecipeOption RecipeDisplayName = #autoLOC_USI_WOLF_FABRICATOR_RECIPE_ELECTRONICS - InputResources = Maintenance,1,MaterialKits,5,Power,1,Synthetics,5,TechnicianCrewPoint,1 + InputResources = Lab,2,Maintenance,2,MaterialKits,5,Power,2,Synthetics,5,EngineerCrewPoint,1 OutputResources = Electronics,1 } MODULE @@ -21,7 +21,7 @@ name = WOLF_RecipeOption RecipeDisplayName = #autoLOC_USI_WOLF_FABRICATOR_RECIPE_PROTOTYPES - InputResources = Electronics,5,Maintenance,1,Power,1,Robotics,5,SpecializedParts,5,TechnicianCrewPoint,1 + InputResources = Electronics,5,Lab,3,Maintenance,3,Power,3,Robotics,5,SpecializedParts,5,EngineerCrewPoint,1,ScientistCrewPoint,1 OutputResources = Prototypes,1 } MODULE @@ -29,7 +29,7 @@ name = WOLF_RecipeOption RecipeDisplayName = #autoLOC_USI_WOLF_FABRICATOR_RECIPE_ROBOTICS - InputResources = Alloys,5,Maintenance,1,MaterialKits,5,Power,1,TechnicianCrewPoint,1 + InputResources = Alloys,5,Lab,2,Maintenance,2,MaterialKits,5,Power,2,EngineerCrewPoint,1 OutputResources = Robotics,1 } MODULE @@ -37,7 +37,7 @@ name = WOLF_RecipeOption RecipeDisplayName = #autoLOC_USI_WOLF_FABRICATOR_RECIPE_SYNTHETICS - InputResources = ExoticMinerals,4,Maintenance,1,Polymers,1,Power,1,TechnicianCrewPoint,1 + InputResources = ExoticMinerals,4,Lab,1,Maintenance,1,Polymers,1,Power,1,ScientistCrewPoint,1 OutputResources = Synthetics,1 } } diff --git a/Source/WOLF/WOLF/Modules/WOLF_CrewTransferScenario.cs b/Source/WOLF/WOLF/Modules/WOLF_CrewTransferScenario.cs index 7115f5a0..626f38ba 100644 --- a/Source/WOLF/WOLF/Modules/WOLF_CrewTransferScenario.cs +++ b/Source/WOLF/WOLF/Modules/WOLF_CrewTransferScenario.cs @@ -19,6 +19,13 @@ namespace WOLF public class WOLF_CrewTransferScenario : ScenarioModule, ICrewTransferController { private const float TERMINAL_RANGE = 500f; + private static readonly List _prefabDefs = new List + { + new PrefabDefinition(PrefabType.Prefab), + new PrefabDefinition(PrefabType.Prefab), + new PrefabDefinition(PrefabType.Prefab), + new PrefabDefinition(PrefabType.Window), + }; private readonly ArrivalWarnings _arrivalWarnings = new ArrivalWarnings(); private readonly Dictionary _activeWarnings @@ -729,7 +736,10 @@ public override void OnAwake() base.OnAwake(); GetLocalizedTextValues(); + } + private void Start() + { var wolfScenario = FindObjectOfType(); _wolf = wolfScenario.ServiceManager.GetService(); @@ -738,30 +748,16 @@ public override void OnAwake() { var serviceManager = usiTools.ServiceManager; var windowManager = serviceManager.GetService(); + var prefabManager = serviceManager.GetService(); try { - // Setup UI prefabs + // Load and register UI prefabs var filepath = Path.Combine(KSPUtil.ApplicationRootPath, "GameData/UmbraSpaceIndustries/WOLF/Assets/UI/CrewTransferWindow.prefabs"); - var prefabs = AssetBundle.LoadFromFile(filepath); - var flightSelectorPrefab = prefabs.LoadAsset("FlightSelector"); - var kerbalSelectorPrefab = prefabs.LoadAsset("KerbalSelector"); - var terminalWindowPrefab = prefabs.LoadAsset("TerminalWindow"); - var warningPanelPrefab = prefabs.LoadAsset("WarningPanel"); - - // Register prefabs with window manager - windowManager - .RegisterPrefab(flightSelectorPrefab) - .RegisterPrefab(kerbalSelectorPrefab) - .RegisterPrefab(warningPanelPrefab) - .RegisterWindow(terminalWindowPrefab); + prefabManager.LoadAssetBundle(filepath, _prefabDefs); } catch (ServiceAlreadyRegisteredException) { } - catch (NullReferenceException) - { - // TODO - Create an asset bundle loader service in USITools - } catch (Exception ex) { Debug.LogError($"[WOLF] {ClassName}: {ex.Message}");