2024-04-16 22:10:46 +00:00
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using rjw;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using Verse;
|
|
|
|
|
|
|
|
|
|
namespace Rimworld_Animations {
|
|
|
|
|
|
|
|
|
|
[HarmonyPatch(typeof(Pawn_DrawTracker), "DrawPos", MethodType.Getter)]
|
|
|
|
|
public static class HarmonyPatch_Pawn_DrawTracker {
|
|
|
|
|
public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) {
|
|
|
|
|
|
2024-04-17 23:57:18 +00:00
|
|
|
|
|
2024-04-18 22:32:31 +00:00
|
|
|
|
CompExtendedAnimator animator = ___pawn.TryGetComp<CompExtendedAnimator>();
|
2024-04-16 22:10:46 +00:00
|
|
|
|
|
2024-04-18 22:32:31 +00:00
|
|
|
|
//align pos on top of partner, position, etc., based on animatoranchor
|
|
|
|
|
if (animator != null && animator.IsAnchored)
|
|
|
|
|
{
|
|
|
|
|
__result = animator.getAnchor();
|
2024-04-16 22:10:46 +00:00
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
2024-04-17 23:57:18 +00:00
|
|
|
|
|
2024-04-16 22:10:46 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|