diff --git a/1.3/Assemblies/Rimworld-Animations.dll b/1.3/Assemblies/Rimworld-Animations.dll index 7f376ba..1699ad3 100644 Binary files a/1.3/Assemblies/Rimworld-Animations.dll and b/1.3/Assemblies/Rimworld-Animations.dll differ diff --git a/1.3/Defs/AnimationDefs/TemplateAnimation.xml b/1.3/Defs/AnimationDefs/TemplateAnimation.xml index 0305903..5760f03 100644 --- a/1.3/Defs/AnimationDefs/TemplateAnimation.xml +++ b/1.3/Defs/AnimationDefs/TemplateAnimation.xml @@ -39,7 +39,54 @@
  • LayingPawn - +
  • +
  • + + +
  • + hand + path/to/texture +
  • +
  • + tail + path/to/texture2 +
  • + + + +
  • + 0 + 10 + 27 + 0.298 + 0.166 + 0 + 1 + 2 + + +
  • + hand + true + 3.2 + 1 + 30 + 1.5 +
  • +
  • + tail + true + 3.2 + 1 + 30 + 1.5 +
  • + ... + + + + ... +
  • diff --git a/1.3/Source/Animations/Clips/PawnAnimationClip.cs b/1.3/Source/Animations/Clips/PawnAnimationClip.cs index e9d2489..820d0fe 100644 --- a/1.3/Source/Animations/Clips/PawnAnimationClip.cs +++ b/1.3/Source/Animations/Clips/PawnAnimationClip.cs @@ -10,6 +10,10 @@ namespace Rimworld_Animations { public class PawnAnimationClip : BaseAnimationClip { public List keyframes; + + public List addons = new List(); + public List addonKeyframes = new List(); + public AltitudeLayer layer = AltitudeLayer.Pawn; public Dictionary quiver = new Dictionary(); @@ -21,6 +25,13 @@ namespace Rimworld_Animations { public SimpleCurve BodyOffsetZ = new SimpleCurve(); public SimpleCurve HeadFacing = new SimpleCurve(); public SimpleCurve BodyFacing = new SimpleCurve(); + + public Dictionary addonsPosX = new Dictionary(); + public Dictionary addonsPosY = new Dictionary(); + + public Dictionary addonsRotation = new Dictionary(); + public Dictionary addonsScale = new Dictionary(); + public Dictionary> addonsShouldRender = new Dictionary>(); public override void buildSimpleCurves() { @@ -32,6 +43,16 @@ namespace Rimworld_Animations { duration += frame.tickDuration; } + foreach(AddonInfo addonInfo in addons) + { + addonsPosX.Add(addonInfo.name, new SimpleCurve()); + addonsPosY.Add(addonInfo.name, new SimpleCurve()); + addonsScale.Add(addonInfo.name, new SimpleCurve()); + + addonsRotation.Add(addonInfo.name, new SimpleCurve()); + addonsShouldRender.Add(addonInfo.name, new Dictionary()); + } + //guarantees loops don't get cut off mid-anim this.duration = duration; @@ -66,7 +87,6 @@ namespace Rimworld_Animations { if (frame.soundEffect != null) { SoundEffects.Add((int)frame.atTick, frame.soundEffect); } - } else { @@ -98,13 +118,48 @@ namespace Rimworld_Animations { SoundEffects.Add(keyframePosition, frame.soundEffect); } - if(frame.tickDuration != 1 && frame.quiver.HasValue) { + foreach (AddonInfo addon in addons) + { + if (frame.addonKeyframes.Exists(addonKeyframe => addonKeyframe.name == addon.name)) + { + AddonKeyframe addonKeyframe = frame.addonKeyframes.Find(element => element.name == addon.name); + if (addonKeyframe.posX != null) + { + addonsPosX[addon.name].Add((float)keyframePosition / (float)duration, addonKeyframe.posX.Value, true); + } + + if (addonKeyframe.posY != null) + { + addonsPosX[addon.name].Add((float)keyframePosition / (float)duration, addonKeyframe.posY.Value, true); + } + + if (addonKeyframe.rotation != null) + { + addonsPosX[addon.name].Add((float)keyframePosition / (float)duration, addonKeyframe.rotation.Value, true); + } + + if (addonKeyframe.scale != null) + { + addonsScale[addon.name].Add((float)keyframePosition / (float)duration, addonKeyframe.scale.Value, true); + } + + if (addonKeyframe.render != null) + { + addonsShouldRender[addon.name].Add(keyframePosition, addonKeyframe.render.Value); + } + + } + } + + if (frame.tickDuration != 1 && frame.quiver.HasValue) { quiver.Add(keyframePosition, true); quiver.Add(keyframePosition + frame.tickDuration - 1, false); } keyframePosition += frame.tickDuration; + + } } diff --git a/1.3/Source/Animations/Keyframes/AddonInfo.cs b/1.3/Source/Animations/Keyframes/AddonInfo.cs new file mode 100644 index 0000000..9824eae --- /dev/null +++ b/1.3/Source/Animations/Keyframes/AddonInfo.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Rimworld_Animations +{ + public class AddonInfo + { + public string name; + public string path; + } +} diff --git a/1.3/Source/Animations/Keyframes/AddonKeyframe.cs b/1.3/Source/Animations/Keyframes/AddonKeyframe.cs new file mode 100644 index 0000000..bc03c7e --- /dev/null +++ b/1.3/Source/Animations/Keyframes/AddonKeyframe.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Rimworld_Animations +{ + public class AddonKeyframe + { + public string name; + public bool? render; + public float? posX, posY, rotation, scale; + } +} diff --git a/1.3/Source/Animations/Keyframes/PawnKeyframe.cs b/1.3/Source/Animations/Keyframes/PawnKeyframe.cs index e710981..67e44fc 100644 --- a/1.3/Source/Animations/Keyframes/PawnKeyframe.cs +++ b/1.3/Source/Animations/Keyframes/PawnKeyframe.cs @@ -24,5 +24,7 @@ namespace Rimworld_Animations { public bool? quiver; + public List addonKeyframes; + } } diff --git a/Patch_SexToysMasturbation/Patch_SexToysMasturbation.csproj b/Patch_SexToysMasturbation/Patch_SexToysMasturbation.csproj index b25b5c2..fc6cbf9 100644 --- a/Patch_SexToysMasturbation/Patch_SexToysMasturbation.csproj +++ b/Patch_SexToysMasturbation/Patch_SexToysMasturbation.csproj @@ -46,11 +46,11 @@ False - ..\..\rjw-master\1.3\Assemblies\RJW.dll + ..\..\rjw\1.3\Assemblies\RJW.dll False - ..\..\rjw-toys-and-masturbation-master\Assemblies\RJW-ToysAndMasturbation.dll + ..\..\rjw-toys-and-masturbation\Assemblies\RJW-ToysAndMasturbation.dll False diff --git a/Rimworld-Animations.csproj b/Rimworld-Animations.csproj index 674eb10..cba8b35 100644 --- a/Rimworld-Animations.csproj +++ b/Rimworld-Animations.csproj @@ -44,11 +44,11 @@ False - ..\rjw-master\1.3\Assemblies\RJW.dll + ..\rjw\1.3\Assemblies\RJW.dll False - ..\rjw-toys-and-masturbation-master\Assemblies\RJW-ToysAndMasturbation.dll + ..\rjw-toys-and-masturbation\Assemblies\RJW-ToysAndMasturbation.dll False @@ -69,6 +69,8 @@ + +