diff --git a/1.2/Assemblies/Rimworld-Animations.dll b/1.2/Assemblies/Rimworld-Animations.dll index 57a3061..3c1bb66 100644 Binary files a/1.2/Assemblies/Rimworld-Animations.dll and b/1.2/Assemblies/Rimworld-Animations.dll differ diff --git a/Source/Comps/CompBodyAnimator.cs b/Source/Comps/CompBodyAnimator.cs index 0a9dc90..2c6fbe2 100644 --- a/Source/Comps/CompBodyAnimator.cs +++ b/Source/Comps/CompBodyAnimator.cs @@ -376,6 +376,29 @@ namespace Rimworld_Animations { public void shiftActorPositionAndRestartAnimation() { actor = (actor == anim.actors.Count - 1 ? 0 : actor + 1); + if (pawn?.story?.bodyType != null) { + if (pawn.story.bodyType == BodyTypeDefOf.Fat && anim?.actors[actor]?.bodyTypeOffset?.Fat != null) { + anchor.x += anim.actors[actor].bodyTypeOffset.Fat.Value.x * (mirror ? -1f : 1f); + anchor.z += anim.actors[actor].bodyTypeOffset.Fat.Value.y; + } + else if (pawn.story.bodyType == BodyTypeDefOf.Female && anim?.actors[actor]?.bodyTypeOffset?.Female != null) { + anchor.x += anim.actors[actor].bodyTypeOffset.Female.Value.x * (mirror ? -1f : 1f); + anchor.z += anim.actors[actor].bodyTypeOffset.Female.Value.y; + } + else if (pawn.story.bodyType == BodyTypeDefOf.Male && anim?.actors[actor]?.bodyTypeOffset?.Male != null) { + anchor.x += anim.actors[actor].bodyTypeOffset.Male.Value.x * (mirror ? -1f : 1f); + anchor.z += anim.actors[actor].bodyTypeOffset.Male.Value.y; + } + else if (pawn.story.bodyType == BodyTypeDefOf.Thin && anim?.actors[actor]?.bodyTypeOffset?.Thin != null) { + anchor.x += anim.actors[actor].bodyTypeOffset.Thin.Value.x * (mirror ? -1f : 1f); + anchor.z += anim.actors[actor].bodyTypeOffset.Thin.Value.y; + } + else if (pawn.story.bodyType == BodyTypeDefOf.Hulk && anim?.actors[actor]?.bodyTypeOffset?.Hulk != null) { + anchor.x += anim.actors[actor].bodyTypeOffset.Hulk.Value.x * (mirror ? -1f : 1f); + anchor.z += anim.actors[actor].bodyTypeOffset.Hulk.Value.y; + } + } + curStage = 0; animTicks = 0; stageTicks = 0; diff --git a/Source/MainTabWindows/MainTabWindow_OffsetConfigure.cs b/Source/MainTabWindows/MainTabWindow_OffsetConfigure.cs index 420e53b..ed4440d 100644 --- a/Source/MainTabWindows/MainTabWindow_OffsetConfigure.cs +++ b/Source/MainTabWindows/MainTabWindow_OffsetConfigure.cs @@ -49,8 +49,7 @@ namespace Rimworld_Animations { AnimationSettings.rotation.Add(def.defName + curPawn.def.defName + ActorIndex, 0); } - - listingStandard.Label("Offset for race " + curPawn.def.defName + " in actor position " + curPawn.TryGetComp().ActorIndex + " for animation " + def.label + (curPawn.TryGetComp().Mirror ? " mirrored" : "")); + listingStandard.Label("Name: " + curPawn.Name + " Race: " + curPawn.def.defName + " Actor Index: " + curPawn.TryGetComp().ActorIndex + " Animation: " + def.label + (curPawn.TryGetComp().Mirror ? " mirrored" : "")); if(curPawn.def.defName == "Human") { listingStandard.Label("Warning--You generally don't want to change human offsets, only alien offsets"); @@ -82,6 +81,15 @@ namespace Rimworld_Animations { for(int i = 0; i < curPawn.TryGetComp().actorsInCurrentAnimation.Count; i++) { curPawn.TryGetComp().actorsInCurrentAnimation[i].TryGetComp()?.shiftActorPositionAndRestartAnimation(); + + //reset the clock time of every pawn in animation + if(curPawn.TryGetComp().actorsInCurrentAnimation[i].jobs.curDriver is rjw.JobDriver_Sex) { + (curPawn.TryGetComp().actorsInCurrentAnimation[i].jobs.curDriver as rjw.JobDriver_Sex).ticks_left = def.animationTimeTicks; + (curPawn.TryGetComp().actorsInCurrentAnimation[i].jobs.curDriver as rjw.JobDriver_Sex).ticksLeftThisToil = def.animationTimeTicks; + (curPawn.TryGetComp().actorsInCurrentAnimation[i].jobs.curDriver as rjw.JobDriver_Sex).duration = def.animationTimeTicks; + (curPawn.TryGetComp().actorsInCurrentAnimation[i].jobs.curDriver as rjw.JobDriver_Sex).ticks_remaining = def.animationTimeTicks; + } + } }