diff --git a/Rimworld-Animations.csproj b/Rimworld-Animations.csproj index 01db0fe..593d1ec 100644 --- a/Rimworld-Animations.csproj +++ b/Rimworld-Animations.csproj @@ -91,6 +91,7 @@ + diff --git a/Source/Patches/HarmonyPatch_DontShaveYourHead.cs b/Source/Patches/HarmonyPatch_DontShaveYourHead.cs new file mode 100644 index 0000000..fa5a5cc --- /dev/null +++ b/Source/Patches/HarmonyPatch_DontShaveYourHead.cs @@ -0,0 +1,29 @@ +using HarmonyLib; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace Rimworld_Animations { + class HarmonyPatch_DontShaveYourHead { + + [StaticConstructorOnStartup] + public static class Patch_DontShaveYourHead { + + static Patch_DontShaveYourHead() { + try { + ((Action)(() => + { + if (LoadedModManager.RunningModsListForReading.Any(x => x.Name == "Don't Shave Your Head 1.0")) { + (new Harmony("rjw")).Patch(AccessTools.Method(AccessTools.TypeByName("DontShaveYourHead.Harmony_PawnRenderer"), "DrawHairReroute"), //typeof(ShowHair.Patch_PawnRenderer_RenderPawnInternal), nameof(ShowHair.Patch_PawnRenderer_RenderPawnInternal.Postfix)), + transpiler: new HarmonyMethod(AccessTools.Method(typeof(Patch_ShowHairWithHats), "Transpiler"))); + } + }))(); + } + catch (TypeLoadException ex) { } + } + } + } +}