From ea3fe70ae33a18cf2f36788bf5138e45224bfe0c Mon Sep 17 00:00:00 2001 From: Lexi Date: Sun, 4 Jun 2023 07:44:50 -0400 Subject: [PATCH] Use nuget assembly for KSP2 and fix colors pre 1.2.1 release --- SpaceWarp/Patching/ColorsPatch.cs | 7 +------ SpaceWarp/SpaceWarp.csproj | 2 +- SpaceWarpPatcher/SpaceWarpPatcher.csproj | 1 + 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/SpaceWarp/Patching/ColorsPatch.cs b/SpaceWarp/Patching/ColorsPatch.cs index 6a2f82ad..9a5a05d7 100644 --- a/SpaceWarp/Patching/ColorsPatch.cs +++ b/SpaceWarp/Patching/ColorsPatch.cs @@ -289,15 +289,10 @@ internal static void Prefix() nameof(Module_Color.OnInitialize))] internal static void Postfix(Module_Color __instance) { - if (DeclaredParts.Count == 0) - { - return; - } - var partName = __instance.OABPart is not null ? __instance.OABPart.PartName : __instance.part.Name; var trimmedPartName = TrimPartName(partName); - if (_allParts.Contains(trimmedPartName)) + if (DeclaredParts.Count > 0 && _allParts.Contains(trimmedPartName)) { var mat = new Material(_ksp2Opaque); mat.name = __instance.GetComponentInChildren().material.name; diff --git a/SpaceWarp/SpaceWarp.csproj b/SpaceWarp/SpaceWarp.csproj index c65fa449..48e1fa1f 100644 --- a/SpaceWarp/SpaceWarp.csproj +++ b/SpaceWarp/SpaceWarp.csproj @@ -4,7 +4,6 @@ $(SpaceWarpVersion) - @@ -18,6 +17,7 @@ + diff --git a/SpaceWarpPatcher/SpaceWarpPatcher.csproj b/SpaceWarpPatcher/SpaceWarpPatcher.csproj index 87854863..cf34c954 100644 --- a/SpaceWarpPatcher/SpaceWarpPatcher.csproj +++ b/SpaceWarpPatcher/SpaceWarpPatcher.csproj @@ -7,6 +7,7 @@ +