rimworld-animations-patch_m.../Source/Scripts/Patches/HarmonyPatch_BabiesAndChild...

51 lines
1.5 KiB
C#
Raw Normal View History

2022-10-02 02:14:35 +00:00
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
{
2023-02-06 00:41:57 +00:00
// To be revisited if BabiesAndChildren is updated
/*[StaticConstructorOnStartup]
2022-10-02 02:14:35 +00:00
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")));
}
}))();
}
2023-02-04 07:13:57 +00:00
catch (TypeLoadException) { }
2022-10-02 02:14:35 +00:00
}
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;
}
2023-02-06 00:41:57 +00:00
}*/
2022-10-02 02:14:35 +00:00
}