reorder actors button

This commit is contained in:
c0ffeeeeeeee 2020-10-28 20:21:19 -07:00
parent f1308c4ecc
commit 7b138a72d9
4 changed files with 36 additions and 6 deletions

View file

@ -29,6 +29,7 @@ namespace Rimworld_Animations {
SexUtility.DrawNude(pawn);
} else {
pawn.Drawer.renderer.graphics.ResolveAllGraphics();
actorsInCurrentAnimation = null;
}
PortraitsCache.SetDirty(pawn);
@ -48,6 +49,8 @@ namespace Rimworld_Animations {
public float bodyAngle = 0, headAngle = 0, genitalAngle = 0;
public Rot4 headFacing = Rot4.North, bodyFacing = Rot4.North;
public List<Pawn> actorsInCurrentAnimation;
public bool controlGenitalAngle = false;
private AnimationDef anim;
@ -102,8 +105,9 @@ namespace Rimworld_Animations {
anchor = thing.Position.ToVector3Shifted();
}
}
public void StartAnimation(AnimationDef anim, int actor, bool mirror = false, bool shiver = false, bool fastAnimForQuickie = false) {
public void StartAnimation(AnimationDef anim, List<Pawn> actors, int actor, bool mirror = false, bool shiver = false, bool fastAnimForQuickie = false) {
actorsInCurrentAnimation = actors;
AlienRaceOffset raceOffset = anim?.actors[actor]?.raceOffsets?.Find(x => x.defName == pawn.def.defName);
if (raceOffset != null) {
@ -198,7 +202,7 @@ namespace Rimworld_Animations {
if (animTicks < anim.animationTimeTicks) {
tickStage();
} else {
isAnimating = false;
}
}
@ -326,7 +330,6 @@ namespace Rimworld_Animations {
}
public AnimationDef CurrentAnimation {
get {
return anim;
@ -370,5 +373,18 @@ namespace Rimworld_Animations {
Scribe_Values.Look(ref quiver, "orgasmQuiver");
}
public void shiftActorPositionAndRestartAnimation() {
actor = (actor == anim.actors.Count - 1 ? 0 : actor + 1);
curStage = 0;
animTicks = 0;
stageTicks = 0;
clipTicks = 0;
controlGenitalAngle = anim.actors[actor].controlGenitalAngle;
tickAnim();
}
}
}