mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
tweaks
This commit is contained in:
parent
6d4ed2a9e3
commit
1eea564e30
5 changed files with 6 additions and 25 deletions
Binary file not shown.
|
@ -279,6 +279,8 @@ namespace Rimworld_Animations {
|
|||
|
||||
public static Rot4 PawnHeadRotInAnimation(Pawn pawn, Rot4 regularPos)
|
||||
{
|
||||
Debug.Log("Test");
|
||||
|
||||
if(pawn?.TryGetComp<CompBodyAnimator>() != null && pawn.TryGetComp<CompBodyAnimator>().isAnimating)
|
||||
{
|
||||
return pawn.TryGetComp<CompBodyAnimator>().headFacing;
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace Rimworld_Animations {
|
|||
actorsInCurrentAnimation = null;
|
||||
}
|
||||
|
||||
PortraitsCache.SetDirty(pawn);
|
||||
}
|
||||
}
|
||||
private bool Animating = false;
|
||||
|
|
|
@ -46,9 +46,6 @@ namespace Rimworld_Animations {
|
|||
|
||||
foreach (CodeInstruction i in instructions)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
if (i.opcode == OpCodes.Ldfld && i.OperandIs(AccessTools.Field(typeof(PawnGraphicSet), "headGraphic")))
|
||||
{
|
||||
|
@ -57,13 +54,14 @@ namespace Rimworld_Animations {
|
|||
yield return i;
|
||||
}
|
||||
|
||||
else if (forHead && i.operand == (object)7)
|
||||
else if (forHead && i.opcode == OpCodes.Ldarg_S && i.operand == (object)4)
|
||||
{
|
||||
|
||||
yield return new CodeInstruction(OpCodes.Ldarg_0);
|
||||
yield return new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(PawnRenderer), "pawn"));
|
||||
yield return new CodeInstruction(OpCodes.Ldloc_S, operand: 7);
|
||||
yield return new CodeInstruction(OpCodes.Ldloc_S, operand: 4);
|
||||
yield return new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(AnimationUtility), "PawnHeadRotInAnimation"));
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
|
|
@ -26,24 +26,4 @@ namespace Rimworld_Animations {
|
|||
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(PawnRenderer), "BodyAngle")]
|
||||
public static class HarmonyPatch_PawnAngle
|
||||
{
|
||||
public static bool Prefix(Pawn ___pawn, ref float __result)
|
||||
{
|
||||
|
||||
if(___pawn.TryGetComp<CompBodyAnimator>().isAnimating)
|
||||
{
|
||||
__result = ___pawn.TryGetComp<CompBodyAnimator>().bodyAngle;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue