Patches for downed pawns with anims not playing + pawn downed wiggler interfering with anims

This commit is contained in:
c0ffee 2024-05-03 18:21:06 -07:00
parent 8a93f3b087
commit 6d174dbce4
6 changed files with 38 additions and 0 deletions

View file

@ -15,6 +15,11 @@ namespace Rimworld_Animations
{
}
public override bool Enabled()
{
return true;
}
public override Vector3 OffsetAtTick(int tick, PawnDrawParms parms)
{
//Todo: Use this for bodyoffsets

View file

@ -0,0 +1,32 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
namespace Rimworld_Animations
{
[HarmonyPatch(typeof(PawnRenderer), "BodyAngle")]
public class HarmonyPatch_PawnRenderer2
{
public static bool Prefix(ref Pawn ___pawn, ref float __result)
{
//stop using cache when animating, for when downed (downed disables cache)
if (___pawn.Drawer.renderer.renderTree.rootNode.AnimationWorker is AnimationWorker_KeyframesExtended)
{
__result = 0;
return false;
}
return true;
}
}
}

View file

@ -104,6 +104,7 @@
<Compile Include="1.5\Source\MainTabWindows\OffsetMainButtonDefOf.cs" />
<Compile Include="1.5\Source\MainTabWindows\WorldComponent_UpdateMainTab.cs" />
<Compile Include="1.5\Source\Patches\Harmony_PatchAll.cs" />
<Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderer.cs" />
<Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderNode.cs" />
<Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderNodeWorker.cs" />
<Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderTree.cs" />