mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
reorder actors button
This commit is contained in:
parent
f1308c4ecc
commit
7b138a72d9
4 changed files with 36 additions and 6 deletions
Binary file not shown.
|
@ -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) {
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace Rimworld_Animations {
|
|||
class MainTabWindow_OffsetConfigure : MainTabWindow
|
||||
{
|
||||
|
||||
public override Vector2 RequestedTabSize => new Vector2(505, 340);
|
||||
public override Vector2 RequestedTabSize => new Vector2(505, 380);
|
||||
public override void DoWindowContents(Rect inRect) {
|
||||
|
||||
Rect position = new Rect(inRect.x, inRect.y, inRect.width, inRect.height);
|
||||
|
@ -20,7 +20,7 @@ namespace Rimworld_Animations {
|
|||
Listing_Standard listingStandard = new Listing_Standard();
|
||||
listingStandard.Begin(position);
|
||||
|
||||
listingStandard.Label("Offset Manager");
|
||||
listingStandard.Label("Animation Manager");
|
||||
|
||||
listingStandard.GapLine();
|
||||
|
||||
|
@ -72,6 +72,20 @@ namespace Rimworld_Animations {
|
|||
rotation = 0;
|
||||
}
|
||||
|
||||
listingStandard.GapLine();
|
||||
|
||||
if(listingStandard.ButtonText("Shift Actors")) {
|
||||
|
||||
if(AnimationSettings.debugMode) {
|
||||
Log.Message("Shifting actors in animation...");
|
||||
}
|
||||
|
||||
for(int i = 0; i < curPawn.TryGetComp<CompBodyAnimator>().actorsInCurrentAnimation.Count; i++) {
|
||||
curPawn.TryGetComp<CompBodyAnimator>().actorsInCurrentAnimation[i].TryGetComp<CompBodyAnimator>()?.shiftActorPositionAndRestartAnimation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (offsetX != AnimationSettings.offsets[def.defName + curPawn.def.defName + ActorIndex].x || offsetZ != AnimationSettings.offsets[def.defName + curPawn.def.defName + ActorIndex].y) {
|
||||
AnimationSettings.offsets[def.defName + curPawn.def.defName + ActorIndex] = new Vector2(offsetX, offsetZ);
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace Rimworld_Animations {
|
|||
}
|
||||
|
||||
bool shiver = pawnsToAnimate[i].jobs.curDriver is JobDriver_SexBaseRecieverRaped;
|
||||
pawnsToAnimate[i].TryGetComp<CompBodyAnimator>().StartAnimation(anim, i, mirror, shiver, fastAnimForQuickie);
|
||||
pawnsToAnimate[i].TryGetComp<CompBodyAnimator>().StartAnimation(anim, pawnsToAnimate, i, mirror, shiver, fastAnimForQuickie);
|
||||
(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_left = anim.animationTimeTicks;
|
||||
(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticksLeftThisToil = anim.animationTimeTicks;
|
||||
(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).duration = anim.animationTimeTicks;
|
||||
|
|
Loading…
Reference in a new issue