mirror of
https://gitgud.io/AbstractConcept/rimworld-animations-patch.git
synced 2024-08-15 00:43:27 +00:00
001121649b
- Fixed a bug that was causing alien addons to not render when pawns were wearing apparel
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
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
|
|
{
|
|
// To be revisited if BabiesAndChildren is updated
|
|
/*[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), "ShouldNotAnimatePawn"),
|
|
prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_BabiesAndChildren), "Prefix_ShouldNotAnimatePawn")));
|
|
(new Harmony("Rimworld_Animations_Patch")).Patch(AccessTools.Method(typeof(AnimationPatchUtility), "GetBodySize"),
|
|
prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_BabiesAndChildren), "Prefix_GetBodySize")));
|
|
}
|
|
}))();
|
|
}
|
|
|
|
catch (TypeLoadException) { }
|
|
}
|
|
|
|
public static bool ShouldNotAnimatePawn(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;
|
|
}
|
|
}*/
|
|
}
|