diff --git a/VisiblePants.csproj b/VisiblePants.csproj index 0e7919d..1d18588 100644 --- a/VisiblePants.csproj +++ b/VisiblePants.csproj @@ -1,5 +1,6 @@  + Debug @@ -12,6 +13,8 @@ v4.7.2 512 + + false @@ -38,7 +41,7 @@ False - ..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll + ..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll False @@ -49,28 +52,19 @@ - ..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll + ..\..\RimWorldWin64_Data\Managed\UnityEngine.dll False - ..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll - False - - - ..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll - False - - - ..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.TextRenderingModule.dll + ..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll False + - - @@ -192,7 +186,12 @@ - - $(ProjectDir)Install.bat $(ConfigurationName) "$(ProjectDir)" "$(ProjectName)" "About Common v1.1 v1.2 v1.3 v1.4 v1.5" "LoadFolders.xml" - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/packages.config b/packages.config index 75a6411..29aaafb 100644 --- a/packages.config +++ b/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/src/HarmonyPatches/Patch_Pawn.cs b/src/HarmonyPatches/Patch_Pawn.cs deleted file mode 100644 index a36434c..0000000 --- a/src/HarmonyPatches/Patch_Pawn.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using Verse; -using HarmonyLib; - -namespace VisiblePants -{ - public static class Patch_Pawn - { - [HarmonyPatch(typeof(Pawn))] - [HarmonyPatch(nameof(Pawn.Tick))] - public static class Patch_Tick - { - // Redraw pawn apparel if settings have changed - public static void Postfix(Pawn __instance) - { - //Don't try to update anything that doesn't have apparel - if (__instance.apparel == null) return; - - //Have to check that we have a valid key - if (__instance.Name == null) return; - - var redrawFound = VisiblePantsUtility.NeedsRedraw.TryGetValue(__instance.Name, out var needsRedraw); - if (needsRedraw || !redrawFound) - { - var sortWornApparelIntoDrawOrder = __instance.apparel.GetType().GetMethod("SortWornApparelIntoDrawOrder", BindingFlags.NonPublic | BindingFlags.Instance); - sortWornApparelIntoDrawOrder.Invoke(__instance.apparel, new object[] { }); - - __instance.apparel.Notify_ApparelChanged(); - - VisiblePantsUtility.NeedsRedraw[__instance.Name] = false; - } - } - } - } -} diff --git a/src/VisiblePantsSettings.cs b/src/VisiblePantsSettings.cs index 260ff3e..649d1a3 100644 --- a/src/VisiblePantsSettings.cs +++ b/src/VisiblePantsSettings.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using RimWorld; +using System.Collections.Generic; using System.Linq; using UnityEngine; using Verse; @@ -27,10 +28,13 @@ public override void ExposeData() { Scribe_Values.Look(ref drawPantsOver, "drawPantsOver", true); base.ExposeData(); - - foreach (var key in VisiblePantsUtility.NeedsRedraw.Keys.ToList()) + foreach (var pawn in PawnsFinder.AllMapsWorldAndTemporary_AliveOrDead) { - VisiblePantsUtility.NeedsRedraw[key] = true; + if (pawn.apparel != null) + { + pawn.apparel.SortWornApparelIntoDrawOrder(); + pawn.apparel.Notify_ApparelChanged(); + } } } } diff --git a/src/VisiblePantsUtility.cs b/src/VisiblePantsUtility.cs deleted file mode 100644 index e287fd8..0000000 --- a/src/VisiblePantsUtility.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; -using Verse; - -namespace VisiblePants -{ - - public static class VisiblePantsUtility - { - public static Dictionary NeedsRedraw = new Dictionary(); - } - -} diff --git a/v1.4/Assemblies/0Harmony.dll b/v1.4/Assemblies/0Harmony.dll new file mode 100644 index 0000000..86fc5eb Binary files /dev/null and b/v1.4/Assemblies/0Harmony.dll differ diff --git a/v1.4/Assemblies/VisiblePants.dll b/v1.4/Assemblies/VisiblePants.dll index db20564..bbf95b9 100644 Binary files a/v1.4/Assemblies/VisiblePants.dll and b/v1.4/Assemblies/VisiblePants.dll differ diff --git a/v1.5/Assemblies/VisiblePants.dll b/v1.5/Assemblies/VisiblePants.dll index 3017042..1327ae5 100644 Binary files a/v1.5/Assemblies/VisiblePants.dll and b/v1.5/Assemblies/VisiblePants.dll differ