mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
loadfolders, 1.2 versioning
This commit is contained in:
parent
a84d6f6a6d
commit
39198bd6b9
115 changed files with 8470 additions and 50 deletions
|
@ -0,0 +1,47 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using HatDisplaySelection;
|
||||
using Rimworld_Animations;
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
|
||||
namespace Patch_HatsDisplaySelection
|
||||
{
|
||||
[HarmonyBefore(new string[] { "velc.HatsDisplaySelection" })]
|
||||
[HarmonyPatch(typeof(HatDisplaySelection.Patch), "Patch_PawnRenderer_RenderPawnInternal_Initialize")]
|
||||
public class Patch_HatsDisplaySelectionInitialize
|
||||
|
||||
{
|
||||
|
||||
public static void Prefix(PawnRenderer __instance, ref Pawn ___pawn, ref Vector3 rootLoc, ref float angle, ref Rot4 bodyFacing, ref Rot4 headFacing)
|
||||
{
|
||||
|
||||
CompBodyAnimator bodyAnim = ___pawn.TryGetComp<CompBodyAnimator>();
|
||||
bodyAnim.animatePawn(ref rootLoc, ref angle, ref bodyFacing, ref headFacing);
|
||||
}
|
||||
|
||||
public static void Postfix(PawnRenderer __instance)
|
||||
{
|
||||
PawnGraphicSet graphics = __instance.graphics;
|
||||
Pawn pawn = graphics.pawn;
|
||||
CompBodyAnimator bodyAnim = pawn.TryGetComp<CompBodyAnimator>();
|
||||
|
||||
if (!graphics.AllResolved)
|
||||
{
|
||||
graphics.ResolveAllGraphics();
|
||||
}
|
||||
|
||||
|
||||
if (bodyAnim != null && bodyAnim.isAnimating && pawn.Map == Find.CurrentMap)
|
||||
{
|
||||
bodyAnim.tickGraphics(graphics);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue