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"))
|
|
|
|
|
{
|
2023-02-08 04:08:58 +00:00
|
|
|
|
(new Harmony("Rimworld_Animations_Patch")).Patch(AccessTools.Method(typeof(AnimationPatchUtility), "ShouldNotAnimatePawn"),
|
|
|
|
|
prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_BabiesAndChildren), "Prefix_ShouldNotAnimatePawn")));
|
2022-10-02 02:14:35 +00:00
|
|
|
|
(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
|
|
|
|
}
|
|
|
|
|
|
2023-02-08 04:08:58 +00:00
|
|
|
|
public static bool ShouldNotAnimatePawn(ref bool __result, Pawn pawn)
|
2022-10-02 02:14:35 +00:00
|
|
|
|
{
|
|
|
|
|
__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
|
|
|
|
}
|