diff --git a/1.5/Assemblies/Rimworld-Animations.dll b/1.5/Assemblies/Rimworld-Animations.dll index 87dd739..1870329 100644 Binary files a/1.5/Assemblies/Rimworld-Animations.dll and b/1.5/Assemblies/Rimworld-Animations.dll differ diff --git a/1.5/Defs/AnimationPropDefs/AnimationPropDef.xml b/1.5/Defs/AnimationPropDefs/AnimationPropDef.xml index df53d62..7815092 100644 --- a/1.5/Defs/AnimationPropDefs/AnimationPropDef.xml +++ b/1.5/Defs/AnimationPropDefs/AnimationPropDef.xml @@ -10,7 +10,7 @@ - + AnimProp_Banana Rimworld_Animations.PawnRenderNode_GraphicVariants Rimworld_Animations.PawnRenderNodeWorker_GraphicVariants @@ -26,7 +26,27 @@
  • AnimationProps/Cat/Cat1
  • AnimationProps/Cat/Cat2
  • + + True
    + + + RenderNodeTag_Genitals + + + + AnimationProp_Genitals + + + AnimProp_Genitals + false + RenderNodeTag_Genitals + Body + + Head + 95 + + diff --git a/1.5/Defs/GroupAnimationDefs/TestGroupAnimation1.xml b/1.5/Defs/GroupAnimationDefs/TestGroupAnimation1.xml index 7fb19e6..6be826f 100644 --- a/1.5/Defs/GroupAnimationDefs/TestGroupAnimation1.xml +++ b/1.5/Defs/GroupAnimationDefs/TestGroupAnimation1.xml @@ -24,53 +24,18 @@ + + + - +
  • @@ -87,12 +52,11 @@
  • - + + +
  • GroinToAppropriateHeight
  • +
  • GroinToAppropriateHeight
  • +
    + diff --git a/1.5/Defs/OffsetDefs/OffsetDef_GroinToAppropriateHeight.xml b/1.5/Defs/OffsetDefs/OffsetDef_GroinToAppropriateHeight.xml index 4503f96..6566375 100644 --- a/1.5/Defs/OffsetDefs/OffsetDef_GroinToAppropriateHeight.xml +++ b/1.5/Defs/OffsetDefs/OffsetDef_GroinToAppropriateHeight.xml @@ -1,38 +1,44 @@  - + GroinToAppropriateHeight - -
  • - Male - (0, 0, 0.5) + +
  • + +
  • Alien_Orassan
  • + + (0, 0, 5) -
    - -
  • - MinecraftCreeper - - - (0, 0, 0.5) - (0, 0, 0.3) - - - (0, 0, 0.5) - (0, 0, 0.3) - - + +
  • + +
  • Human
  • + + +
  • Hulk(0, 0, 0.5)
  • +
  • Thin(0, 0, 0.3)
  • +
  • Female(0, 0, 0.4)
  • +
    -
  • - MinecraftPig - Male - (0, 0, -0.5) + +
  • + +
  • MinecraftCreeper
  • + + +
  • Hulk(0, 0, 0.5)
  • +
  • Male(0, 0, 0.5)
  • +
  • Female(0, 0, 0.5)
  • +
  • Thin(0, 0, 0.3)
  • +
    + +
  • Hulk(0, 0, 0.5)
  • +
  • Male(0, 0, 0.5)
  • +
  • Female(0, 0, 0.5)
  • +
  • Thin(0, 0, 0.3)
  • +
    -
  • - MinecraftPig - Female - (0, 0, -0.5) -
  • -
    -
    + +
    \ No newline at end of file diff --git a/1.5/Patches/AnimationPatch_PawnRenderTree_OffsetSubWorker.xml b/1.5/Patches/AnimationPatch_PawnRenderTree_OffsetSubWorker.xml new file mode 100644 index 0000000..6aa36a8 --- /dev/null +++ b/1.5/Patches/AnimationPatch_PawnRenderTree_OffsetSubWorker.xml @@ -0,0 +1,27 @@ + + + + + Always + +
  • + /Defs/PawnRenderTreeDef/root/subworkerClasses + Always + + /Defs/PawnRenderTreeDef/root + + + + +
  • + +
  • + /Defs/PawnRenderTreeDef/root/subworkerClasses + +
  • Rimworld_Animations.PawnRenderSubWorker_ChangeOffset
  • + + +
    +
    + +
    \ No newline at end of file diff --git a/1.5/Source/Actors/BodyTypeOffset.cs b/1.5/Source/Actors/BodyTypeOffset.cs deleted file mode 100644 index 82a23a3..0000000 --- a/1.5/Source/Actors/BodyTypeOffset.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; - -namespace Rimworld_Animations { - public class BodyTypeOffset { - - public Vector2? Male; - public Vector2? Female; - public Vector2? Thin; - public Vector2? Hulk; - public Vector2? Fat; - - } -} diff --git a/1.5/Source/Animations/AnimationOffsets/AnimationOffsetDef.cs b/1.5/Source/Animations/AnimationOffsets/AnimationOffsetDef.cs new file mode 100644 index 0000000..a939d66 --- /dev/null +++ b/1.5/Source/Animations/AnimationOffsets/AnimationOffsetDef.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace Rimworld_Animations +{ + public class AnimationOffsetDef : Def + { + + public List offsets; + + public Vector3 FindOffset(Pawn pawn) + { + foreach (BaseAnimationOffset animOffset in offsets) + { + if (animOffset.appliesToPawn(pawn)) { + + Vector3? offset = animOffset.getOffset(pawn); + return (offset == null ? Vector3.zero : (Vector3)offset); + + } + } + + return Vector3.zero; + } + + + } +} diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyType.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyType.cs new file mode 100644 index 0000000..3ea9f74 --- /dev/null +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyType.cs @@ -0,0 +1,23 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace Rimworld_Animations +{ + public class AnimationOffset_BodyType : BaseAnimationOffset + { + + public List offsets; + + public override Vector3? getOffset(Pawn pawn) + { + return offsets.Find(x => x.bodyType == pawn.story.bodyType)?.offset; + } + } + +} diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyTypeGendered.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyTypeGendered.cs new file mode 100644 index 0000000..3809af2 --- /dev/null +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyTypeGendered.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace Rimworld_Animations +{ + public class AnimationOffset_BodyTypeGendered : BaseAnimationOffset + { + + public List offsetsMale; + public List offsetsFemale; + + public override Vector3? getOffset(Pawn pawn) + { + if (pawn.gender == Gender.Female) + { + return offsetsFemale.Find(x => x.bodyType == pawn.story.bodyType)?.offset; + } + else + { + return offsetsMale.Find(x => x.bodyType == pawn.story.bodyType)?.offset; + } + + } + } +} diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_Single.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_Single.cs new file mode 100644 index 0000000..7ea3135 --- /dev/null +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_Single.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace Rimworld_Animations +{ + public class AnimationOffset_Single : BaseAnimationOffset + { + + public Vector3 offset; + + public override Vector3? getOffset(Pawn pawn) + { + return offset; + } + } +} diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/BaseAnimationOffset.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/BaseAnimationOffset.cs new file mode 100644 index 0000000..d0ccd19 --- /dev/null +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/BaseAnimationOffset.cs @@ -0,0 +1,25 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace Rimworld_Animations +{ + public abstract class BaseAnimationOffset + { + public List races; + + public abstract Vector3? getOffset(Pawn pawn); + + public bool appliesToPawn(Pawn pawn) + { + return races.Contains(pawn.def); + + } + + } +} diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/BodyTypeOffset.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/BodyTypeOffset.cs new file mode 100644 index 0000000..92e7b71 --- /dev/null +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/BodyTypeOffset.cs @@ -0,0 +1,17 @@ +using RimWorld; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Rimworld_Animations +{ + + public class BodyTypeOffset + { + public BodyTypeDef bodyType; + public Vector3 offset; + } +} diff --git a/1.5/Source/AnimationProps/AnimationPropDef.cs b/1.5/Source/Animations/AnimationProps/AnimationPropDef.cs similarity index 74% rename from 1.5/Source/AnimationProps/AnimationPropDef.cs rename to 1.5/Source/Animations/AnimationProps/AnimationPropDef.cs index 1b4c1c3..9acab99 100644 --- a/1.5/Source/AnimationProps/AnimationPropDef.cs +++ b/1.5/Source/Animations/AnimationProps/AnimationPropDef.cs @@ -10,7 +10,7 @@ namespace Rimworld_Animations public class AnimationPropDef : Def { - public PawnRenderNodeProperties_GraphicVariants animPropProperties; + public PawnRenderNodeProperties animPropProperties; } } diff --git a/1.5/Source/AnimationWorkers/AnimationWorker_KeyframesExtended.cs b/1.5/Source/Animations/AnimationWorkers/AnimationWorker_KeyframesExtended.cs similarity index 98% rename from 1.5/Source/AnimationWorkers/AnimationWorker_KeyframesExtended.cs rename to 1.5/Source/Animations/AnimationWorkers/AnimationWorker_KeyframesExtended.cs index ae12151..1b41241 100644 --- a/1.5/Source/AnimationWorkers/AnimationWorker_KeyframesExtended.cs +++ b/1.5/Source/Animations/AnimationWorkers/AnimationWorker_KeyframesExtended.cs @@ -18,6 +18,7 @@ namespace Rimworld_Animations public override Vector3 OffsetAtTick(int tick, PawnDrawParms parms) { //Todo: Use this for bodyoffsets + //or maybe make a rendersubworker for it instead return base.OffsetAtTick(tick, parms); } diff --git a/1.5/Source/GroupAnimations/GroupAnimationContexts/BaseGroupAnimationContext.cs b/1.5/Source/Animations/GroupAnimations/GroupAnimationContexts/BaseGroupAnimationContext.cs similarity index 100% rename from 1.5/Source/GroupAnimations/GroupAnimationContexts/BaseGroupAnimationContext.cs rename to 1.5/Source/Animations/GroupAnimations/GroupAnimationContexts/BaseGroupAnimationContext.cs diff --git a/1.5/Source/GroupAnimations/GroupAnimationContexts/GroupAnimationContext_RJWSex.cs b/1.5/Source/Animations/GroupAnimations/GroupAnimationContexts/GroupAnimationContext_RJWSex.cs similarity index 100% rename from 1.5/Source/GroupAnimations/GroupAnimationContexts/GroupAnimationContext_RJWSex.cs rename to 1.5/Source/Animations/GroupAnimations/GroupAnimationContexts/GroupAnimationContext_RJWSex.cs diff --git a/1.5/Source/GroupAnimations/GroupAnimationDef.cs b/1.5/Source/Animations/GroupAnimations/GroupAnimationDef.cs similarity index 80% rename from 1.5/Source/GroupAnimations/GroupAnimationDef.cs rename to 1.5/Source/Animations/GroupAnimations/GroupAnimationDef.cs index c54984f..55f3bea 100644 --- a/1.5/Source/GroupAnimations/GroupAnimationDef.cs +++ b/1.5/Source/Animations/GroupAnimations/GroupAnimationDef.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using UnityEngine; using Verse; namespace Rimworld_Animations @@ -12,6 +13,7 @@ namespace Rimworld_Animations public int numActors; public List animationStages; public List contexts; + public List offsetDefs; public bool canAnimationBeUsed(List actors, out int reorder) @@ -48,5 +50,12 @@ namespace Rimworld_Animations return animations; } + + public Vector3? GetOffset(int actor, Pawn pawn, int reorder = 0) + { + //element at or default to stop errors + if (offsetDefs == null) return null; + return offsetDefs[(actor + reorder) % numActors].FindOffset(pawn); + } } } diff --git a/1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage.cs b/1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage.cs similarity index 100% rename from 1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage.cs rename to 1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage.cs diff --git a/1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage_Branch.cs b/1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage_Branch.cs new file mode 100644 index 0000000..abee2e7 --- /dev/null +++ b/1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage_Branch.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace Rimworld_Animations +{ + public class AnimationStage_Branch : AnimationStage + { + public List paths; + public override List GetAnimations(int actorNumber, int seed) + { + List animationDefs = new List(); + + //loop thru the selected groupanimationdef path + foreach (AnimationStage stage in paths[(seed * 59) % paths.Count].animationStages) + { + animationDefs.AddRange(stage.GetAnimations(actorNumber, seed)); + } + + return animationDefs; + } + } +} diff --git a/1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage_LoopRandomSelectChance.cs b/1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage_LoopRandomSelectChance.cs similarity index 100% rename from 1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage_LoopRandomSelectChance.cs rename to 1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage_LoopRandomSelectChance.cs diff --git a/1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage_TicksDuration.cs b/1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage_TicksDuration.cs similarity index 100% rename from 1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage_TicksDuration.cs rename to 1.5/Source/Animations/GroupAnimations/GroupAnimationStages/AnimationStage_TicksDuration.cs diff --git a/1.5/Source/Keyframes/ExtendedKeyframe.cs b/1.5/Source/Animations/Keyframes/ExtendedKeyframe.cs similarity index 100% rename from 1.5/Source/Keyframes/ExtendedKeyframe.cs rename to 1.5/Source/Animations/Keyframes/ExtendedKeyframe.cs diff --git a/1.5/Source/Comps/CompExtendedAnimator.cs b/1.5/Source/Comps/CompExtendedAnimator.cs index a34c8ed..a85a5fc 100644 --- a/1.5/Source/Comps/CompExtendedAnimator.cs +++ b/1.5/Source/Comps/CompExtendedAnimator.cs @@ -19,6 +19,7 @@ namespace Rimworld_Animations { private List animationQueue; private BaseExtendedAnimatorAnchor anchor; + private Vector3? offset; private bool isAnimating = false; @@ -38,12 +39,23 @@ namespace Rimworld_Animations { } } + public Vector3? Offset + { + get + { + return offset; + } + set + { + this.offset = value; + } + } + public Vector3 getAnchor() { return anchor.getDrawPos(); } - public override void CompTick() { if (isAnimating) @@ -99,19 +111,21 @@ namespace Rimworld_Animations { isAnimating = false; animationQueue = null; anchor = null; + offset = null; pawn.Drawer.renderer.SetAnimation(null); } - public void PlayGroupAnimation(List groupAnimation) + public void PlayGroupAnimation(List groupAnimation, Vector3? offset) { + this.Offset = offset; animationQueue = groupAnimation; PlayNextAnimation(); } - public void PlayGroupAnimation(List groupAnimation, BaseExtendedAnimatorAnchor anchor) + public void PlayGroupAnimation(List groupAnimation, Vector3? offset, BaseExtendedAnimatorAnchor anchor) { this.anchor = anchor; - PlayGroupAnimation(groupAnimation); + PlayGroupAnimation(groupAnimation, offset); } public override void PostExposeData() @@ -137,8 +151,16 @@ namespace Rimworld_Animations { //if animation makes use of prop, if (AnimationMakesUseOfProp(animationProp)) { + + PawnRenderNodeProperties props = animationProp.animPropProperties; + //create new render node - PawnRenderNode_GraphicVariants animRenderNode = new PawnRenderNode_GraphicVariants(pawn, animationProp.animPropProperties, pawn.Drawer.renderer.renderTree); + PawnRenderNode animRenderNode = (PawnRenderNode)Activator.CreateInstance(props.nodeClass, new object[] { + this.pawn, + props, + pawn.Drawer.renderer.renderTree + }); + animRenderNodes.Add(animRenderNode); } diff --git a/1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage_Branch.cs b/1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage_Branch.cs deleted file mode 100644 index a187270..0000000 --- a/1.5/Source/GroupAnimations/GroupAnimationStages/AnimationStage_Branch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace Rimworld_Animations -{ - public class AnimationStage_Branch : AnimationStage - { - public List paths; - public override List GetAnimations(int actorNumber, int seed) - { - return paths[(seed * 59) % paths.Count].GetAnimations(actorNumber, seed); - } - } -} diff --git a/1.5/Source/Patches/RimworldPatches/HarmonyPatch_PawnRenderTree.cs b/1.5/Source/Patches/RimworldPatches/HarmonyPatch_PawnRenderTree.cs index 6dc336f..621b881 100644 --- a/1.5/Source/Patches/RimworldPatches/HarmonyPatch_PawnRenderTree.cs +++ b/1.5/Source/Patches/RimworldPatches/HarmonyPatch_PawnRenderTree.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using UnityEngine; using Verse; namespace Rimworld_Animations @@ -13,9 +14,11 @@ namespace Rimworld_Animations [HarmonyPatch(typeof(PawnRenderTree), "TryGetMatrix")] public class HarmonyPatch_PawnRenderTree { - public static void Prefix(PawnRenderTree __instance, Dictionary ___nodesByTag, PawnRenderNode node, ref PawnDrawParms parms) + public static bool Prefix(PawnRenderTree __instance, Dictionary ___nodesByTag, PawnRenderNode node, ref PawnDrawParms parms, ref Matrix4x4 matrix, ref bool __result) { - + /* + * Facing fix + */ //find lowest parent that is animating, or nothing if not animating PawnRenderNode animatingNode = node; while (animatingNode != null @@ -30,6 +33,27 @@ namespace Rimworld_Animations //change parm to facing to animate correctly parms.facing = animatingNodeAnimationWorker.facingAtTick(__instance.AnimationTick); } + + /* + * Set Render Node to absolute position + */ + if (node.Props is PawnRenderNodeProperties_GraphicVariants graphicVariantProp + && graphicVariantProp.absolutePosition) + { + matrix = parms.matrix; + float num = node.Worker.AltitudeFor(node, parms); + if (num != 0f) + { + matrix *= Matrix4x4.Translate(Vector3.up * num); + } + + __result = true; + return false; + + } + + return true; + } } diff --git a/1.5/Source/PawnRenderNode/PawnRenderNodeProperties_GraphicVariants.cs b/1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeProperties_GraphicVariants.cs similarity index 87% rename from 1.5/Source/PawnRenderNode/PawnRenderNodeProperties_GraphicVariants.cs rename to 1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeProperties_GraphicVariants.cs index 7667a26..b1a8720 100644 --- a/1.5/Source/PawnRenderNode/PawnRenderNodeProperties_GraphicVariants.cs +++ b/1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeProperties_GraphicVariants.cs @@ -11,6 +11,7 @@ namespace Rimworld_Animations { public List texPathVariants; + public bool absolutePosition = false; } } diff --git a/1.5/Source/PawnRenderNode/PawnRenderNodeWorker_GraphicVariants.cs b/1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeWorker_GraphicVariants.cs similarity index 100% rename from 1.5/Source/PawnRenderNode/PawnRenderNodeWorker_GraphicVariants.cs rename to 1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeWorker_GraphicVariants.cs diff --git a/1.5/Source/PawnRenderNode/PawnRenderNode_GraphicVariants.cs b/1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNode_GraphicVariants.cs similarity index 100% rename from 1.5/Source/PawnRenderNode/PawnRenderNode_GraphicVariants.cs rename to 1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNode_GraphicVariants.cs diff --git a/1.5/Source/RenderSubWorkers/PawnRenderSubWorker_ChangeOffset.cs b/1.5/Source/RenderSubWorkers/PawnRenderSubWorker_ChangeOffset.cs new file mode 100644 index 0000000..2ce182e --- /dev/null +++ b/1.5/Source/RenderSubWorkers/PawnRenderSubWorker_ChangeOffset.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; +using Verse; + +namespace Rimworld_Animations +{ + public class PawnRenderSubWorker_ChangeOffset : PawnRenderSubWorker + { + + public override void TransformOffset(PawnRenderNode node, PawnDrawParms parms, ref Vector3 offset, ref Vector3 pivot) + { + if (node.AnimationWorker is AnimationWorker_KeyframesExtended + && node.tree.pawn.TryGetComp(out CompExtendedAnimator extendedAnimator) + && extendedAnimator.IsAnimating) + { + Vector3? pawnOffset = extendedAnimator.Offset; + if (pawnOffset != null) + { + offset += (Vector3)pawnOffset; + } + + } + } + + } +} diff --git a/1.5/Source/Utilities/AnimationUtility.cs b/1.5/Source/Utilities/AnimationUtility.cs index 71c785a..2431db7 100644 --- a/1.5/Source/Utilities/AnimationUtility.cs +++ b/1.5/Source/Utilities/AnimationUtility.cs @@ -30,20 +30,21 @@ namespace Rimworld_Animations { for (int i = 0; i < participants.Count; i++) { + + Vector3? offset = groupAnimationDef.GetOffset(i, participants[i], reorder); + if (anchor is Pawn pawn && pawn == participants[i]) { List allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder); - participants[i].TryGetComp().PlayGroupAnimation(allAnimationsForPawn); + participants[i].TryGetComp().PlayGroupAnimation(allAnimationsForPawn, offset); } else { //each participant gets their own unique extendedanimatoranchor, important for scribe_deep saving - List allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder); BaseExtendedAnimatorAnchor animatorAnchor = new ExtendedAnimatorAnchor_Thing(anchor); - - participants[i].TryGetComp().PlayGroupAnimation(allAnimationsForPawn, animatorAnchor); + participants[i].TryGetComp().PlayGroupAnimation(allAnimationsForPawn, offset, animatorAnchor); } } } @@ -56,7 +57,8 @@ namespace Rimworld_Animations { for (int i = 0; i < participants.Count; i++) { List allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder); - participants[i].TryGetComp().PlayGroupAnimation(allAnimationsForPawn); + Vector3? offset = groupAnimationDef.GetOffset(i, participants[i], reorder); + participants[i].TryGetComp().PlayGroupAnimation(allAnimationsForPawn, offset); } } diff --git a/Patch_HumanoidAlienRaces/1.5/Assemblies/Patch_HumanoidAlienRaces.dll b/Patch_HumanoidAlienRaces/1.5/Assemblies/Patch_HumanoidAlienRaces.dll index 5673f48..dc15131 100644 Binary files a/Patch_HumanoidAlienRaces/1.5/Assemblies/Patch_HumanoidAlienRaces.dll and b/Patch_HumanoidAlienRaces/1.5/Assemblies/Patch_HumanoidAlienRaces.dll differ diff --git a/Patch_HumanoidAlienRaces/1.5/Source/Patches/Harmony_PatchAll.cs b/Patch_HumanoidAlienRaces/1.5/Source/Patches/Harmony_PatchAll.cs new file mode 100644 index 0000000..1ce3601 --- /dev/null +++ b/Patch_HumanoidAlienRaces/1.5/Source/Patches/Harmony_PatchAll.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using HarmonyLib; +using System.Reflection; + +namespace Patch_SexToysMasturbation +{ + + [StaticConstructorOnStartup] + public static class Harmony_PatchAll { + + static Harmony_PatchAll() { + + Harmony val = new Harmony("harmonypatch"); + val.PatchAll(Assembly.GetExecutingAssembly()); + + } + } +} diff --git a/Patch_HumanoidAlienRaces/Patch_HumanoidAlienRaces.csproj b/Patch_HumanoidAlienRaces/Patch_HumanoidAlienRaces.csproj index 4661863..5841608 100644 --- a/Patch_HumanoidAlienRaces/Patch_HumanoidAlienRaces.csproj +++ b/Patch_HumanoidAlienRaces/Patch_HumanoidAlienRaces.csproj @@ -38,6 +38,7 @@ ..\..\..\..\..\workshop\content\294100\839005762\1.5\Assemblies\AlienRace.dll + False ..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll @@ -69,7 +70,12 @@ + + + + + \ No newline at end of file diff --git a/Rimworld-Animations.csproj b/Rimworld-Animations.csproj index 5663d12..e676bbd 100644 --- a/Rimworld-Animations.csproj +++ b/Rimworld-Animations.csproj @@ -71,9 +71,14 @@ - - - + + + + + + + + @@ -82,14 +87,14 @@ - - - - - - - - + + + + + + + + @@ -107,9 +112,10 @@ - - - + + + + @@ -127,6 +133,7 @@ + @@ -178,7 +185,6 @@ - \ No newline at end of file