mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
HatsDisplaySelection patches
This commit is contained in:
parent
acfb864629
commit
8deae217e0
13 changed files with 208 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
|||
/*using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
@ -19,8 +19,34 @@ namespace Rimworld_Animations {
|
|||
|
||||
(new Harmony("rjw")).Patch(AccessTools.Method(AccessTools.TypeByName("HatDisplaySelection.Patch"), "DrawHatWithHair"),
|
||||
transpiler: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_HatsDisplaySelection), "ReplaceDrawMeshOrLaterWithAnimate")));
|
||||
|
||||
(new Harmony("rjw")).Patch(AccessTools.Method(AccessTools.TypeByName("HatDisplaySelection.Patch"), "DrawHeadApparelWithHair"),
|
||||
prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_HatsDisplaySelection), "PrefixPatchForDrawHeadApparelWithHair")));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void PrefixPatchForDrawHeadApparelWithHair(PawnRenderer renderer, ref Vector3 rootLoc, ref float angle, bool renderBody, ref Rot4 bodyFacing, ref Rot4 headFacing, RotDrawMode bodyDrawType, bool portrait, bool headStump, bool invisible)
|
||||
{
|
||||
PawnGraphicSet graphics = renderer.graphics;
|
||||
Pawn pawn = graphics.pawn;
|
||||
CompBodyAnimator bodyAnim = pawn.TryGetComp<CompBodyAnimator>();
|
||||
|
||||
if (!graphics.AllResolved)
|
||||
{
|
||||
graphics.ResolveAllGraphics();
|
||||
}
|
||||
|
||||
|
||||
if (bodyAnim != null && bodyAnim.isAnimating && !portrait && pawn.Map == Find.CurrentMap)
|
||||
{
|
||||
bodyAnim.tickGraphics(graphics);
|
||||
bodyAnim.animatePawn(ref rootLoc, ref angle, ref bodyFacing, ref headFacing);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static IEnumerable<CodeInstruction> ReplaceDrawMeshOrLaterWithAnimate(IEnumerable<CodeInstruction> instructions) {
|
||||
|
||||
MethodInfo drawMeshNowOrLater = AccessTools.Method(typeof(GenDraw), "DrawMeshNowOrLater");
|
||||
|
@ -44,4 +70,4 @@ namespace Rimworld_Animations {
|
|||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue