using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Verse; using HarmonyLib; using BabiesAndChildren; using BabiesAndChildren.api; namespace Rimworld_Animations_Patch { [StaticConstructorOnStartup] public static class HarmonyPatch_BabiesAndChildren { static HarmonyPatch_BabiesAndChildren() { try { ((Action)(() => { if (LoadedModManager.RunningModsListForReading.Any(x => x.PackageIdPlayerFacing == "babies.and.children.continued.13")) { (new Harmony("Rimworld_Animations_Patch")).Patch(AccessTools.Method(typeof(AnimationPatchUtility), "ShouldNotDrawAddonsForPawn"), prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_BabiesAndChildren), "Prefix_ShouldNotDrawAddonsForPawn"))); (new Harmony("Rimworld_Animations_Patch")).Patch(AccessTools.Method(typeof(AnimationPatchUtility), "GetBodySize"), prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_BabiesAndChildren), "Prefix_GetBodySize"))); } }))(); } catch (TypeLoadException ex) { } } public static bool Prefix_ShouldNotDrawAddonsForPawn(ref bool __result, Pawn pawn) { __result = AgeStages.IsYoungerThan(pawn, AgeStages.Child, false); return false; } public static bool Prefix_GetBodySize(ref float __result, Pawn pawn) { __result = pawn.ShouldBeScaled() ? ChildrenUtility.GetBodySize(pawn) : 1f; return false; } } }