From 0ffbf3656f1efff616cf99bbc13efc97560b29be Mon Sep 17 00:00:00 2001 From: tjdeckard Date: Wed, 25 Aug 2021 21:05:35 -0400 Subject: [PATCH 1/2] Update WOLF fabricator recipes for Konstruction resources --- .../UmbraSpaceIndustries/WOLF/Patches/Konstruction.cfg | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/WOLF/Patches/Konstruction.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/WOLF/Patches/Konstruction.cfg index 14c62a4ac..713be4a4f 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 } } From 29b61b845e62e388441ec35c0ffacc698907f779 Mon Sep 17 00:00:00 2001 From: "T.J. Deckard" Date: Sun, 3 Oct 2021 20:13:27 -0400 Subject: [PATCH 2/2] Fix crew xfer window nullref issue --- .../WOLF/Modules/WOLF_CrewTransferScenario.cs | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Source/WOLF/WOLF/Modules/WOLF_CrewTransferScenario.cs b/Source/WOLF/WOLF/Modules/WOLF_CrewTransferScenario.cs index 7115f5a0a..626f38baa 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}");