mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
38 lines
940 B
C#
38 lines
940 B
C#
|
using HarmonyLib;
|
|||
|
using RimWorld;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using Verse;
|
|||
|
|
|||
|
namespace Rimworld_Animations
|
|||
|
{
|
|||
|
|
|||
|
[HarmonyPatch(typeof(PawnRenderNodeWorker), "CanDrawNow")]
|
|||
|
public class HarmonyPatch_PawnRenderTreeWorker
|
|||
|
{
|
|||
|
public static bool Prefix(PawnRenderNode node, ref bool __result)
|
|||
|
{
|
|||
|
//switching to this system so that head or body can be hidden separate from other nodes
|
|||
|
//(hide head but not addons, etc)
|
|||
|
//in case someone wanted to do that
|
|||
|
|
|||
|
if (node.AnimationWorker is AnimationWorker_KeyframesExtended animWorker)
|
|||
|
{
|
|||
|
if (!animWorker.visibleAtTick(node.tree.AnimationTick))
|
|||
|
{
|
|||
|
__result = false;
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|