mirror of
				https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
				synced 2024-08-15 00:43:45 +00:00 
			
		
		
		
	added:
offsets, dynamically set in animation animation prop graphics, absolute positioning, changing textures, can be used in animation
This commit is contained in:
		
							parent
							
								
									6b5c67018a
								
							
						
					
					
						commit
						32f3b1522f
					
				
					 34 changed files with 424 additions and 144 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -10,7 +10,7 @@
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		<!-- Note: props always return graphic_multi; set cardinal textures to blank and only north in anim if only one tex-->
 | 
							<!-- Note: props always return graphic_multi; set cardinal textures to blank and only north in anim if only one tex-->
 | 
				
			||||||
		<!-- or draw east, south, and west directions, use them in animations? -->
 | 
							<!-- or draw east, south, and west directions, use them in animations? -->
 | 
				
			||||||
		<animPropProperties>
 | 
							<animPropProperties Class="Rimworld_Animations.PawnRenderNodeProperties_GraphicVariants">
 | 
				
			||||||
			<debugLabel>AnimProp_Banana</debugLabel>
 | 
								<debugLabel>AnimProp_Banana</debugLabel>
 | 
				
			||||||
			<nodeClass>Rimworld_Animations.PawnRenderNode_GraphicVariants</nodeClass>
 | 
								<nodeClass>Rimworld_Animations.PawnRenderNode_GraphicVariants</nodeClass>
 | 
				
			||||||
			<workerClass>Rimworld_Animations.PawnRenderNodeWorker_GraphicVariants</workerClass>
 | 
								<workerClass>Rimworld_Animations.PawnRenderNodeWorker_GraphicVariants</workerClass>
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,27 @@
 | 
				
			||||||
				<li>AnimationProps/Cat/Cat1</li>
 | 
									<li>AnimationProps/Cat/Cat1</li>
 | 
				
			||||||
				<li>AnimationProps/Cat/Cat2</li>
 | 
									<li>AnimationProps/Cat/Cat2</li>
 | 
				
			||||||
			</texPathVariants>
 | 
								</texPathVariants>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<absolutePosition>True</absolutePosition>
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
		</animPropProperties>
 | 
							</animPropProperties>
 | 
				
			||||||
	</Rimworld_Animations.AnimationPropDef>
 | 
						</Rimworld_Animations.AnimationPropDef>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						<PawnRenderNodeTagDef>
 | 
				
			||||||
 | 
							<defName>RenderNodeTag_Genitals</defName>
 | 
				
			||||||
 | 
						</PawnRenderNodeTagDef>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						<Rimworld_Animations.AnimationPropDef>
 | 
				
			||||||
 | 
							<defName>AnimationProp_Genitals</defName>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							<animPropProperties>
 | 
				
			||||||
 | 
								<debugLabel>AnimProp_Genitals</debugLabel>
 | 
				
			||||||
 | 
								<useGraphic>false</useGraphic>
 | 
				
			||||||
 | 
								<tagDef>RenderNodeTag_Genitals</tagDef>
 | 
				
			||||||
 | 
								<parentTagDef>Body</parentTagDef>
 | 
				
			||||||
 | 
								<!-- for height -->
 | 
				
			||||||
 | 
								<overlayLayer>Head</overlayLayer>
 | 
				
			||||||
 | 
								<baseLayer>95</baseLayer>
 | 
				
			||||||
 | 
							</animPropProperties>
 | 
				
			||||||
 | 
						</Rimworld_Animations.AnimationPropDef>
 | 
				
			||||||
</Defs>
 | 
					</Defs>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,53 +24,18 @@
 | 
				
			||||||
					</li>
 | 
										</li>
 | 
				
			||||||
				</loopOptions>
 | 
									</loopOptions>
 | 
				
			||||||
			</li>
 | 
								</li>
 | 
				
			||||||
 | 
								
 | 
				
			||||||
 | 
								<!--
 | 
				
			||||||
			<li Class="Rimworld_Animations.AnimationStage_Branch">
 | 
								<li Class="Rimworld_Animations.AnimationStage_Branch">
 | 
				
			||||||
				<paths>
 | 
									<paths>
 | 
				
			||||||
					<li Class="Rimworld_Animations.AnimationStage_LoopRandomSelectChance">
 | 
										<li>GroupAnimationDef1_1</li>
 | 
				
			||||||
						<loops>10</loops>
 | 
										<li>GroupAnimationDef1_2</li>
 | 
				
			||||||
						<loopOptions>
 | 
					 | 
				
			||||||
							<li>
 | 
					 | 
				
			||||||
								<probability>3</probability>
 | 
					 | 
				
			||||||
								<animationDefs>
 | 
					 | 
				
			||||||
									<li>TestAnimation1</li>
 | 
					 | 
				
			||||||
									<li>TestAnimation1</li>
 | 
					 | 
				
			||||||
								</animationDefs>
 | 
					 | 
				
			||||||
							</li>
 | 
					 | 
				
			||||||
							<li>
 | 
					 | 
				
			||||||
								<probability>1</probability>
 | 
					 | 
				
			||||||
								<animationDefs>
 | 
					 | 
				
			||||||
									<li>TestAnimation1</li>
 | 
					 | 
				
			||||||
									<li>TestAnimation1</li>
 | 
					 | 
				
			||||||
								</animationDefs>
 | 
					 | 
				
			||||||
							</li>
 | 
					 | 
				
			||||||
						</loopOptions>
 | 
					 | 
				
			||||||
						
 | 
					 | 
				
			||||||
					</li>
 | 
					 | 
				
			||||||
					<li Class="Rimworld_Animations.AnimationStage_LoopRandomSelectChance">
 | 
					 | 
				
			||||||
						<loops>10</loops>
 | 
					 | 
				
			||||||
						<loopOptions>
 | 
					 | 
				
			||||||
							<li>
 | 
					 | 
				
			||||||
								<probability>3</probability>
 | 
					 | 
				
			||||||
								<animationDefs>
 | 
					 | 
				
			||||||
									<li>TestAnimation2</li>
 | 
					 | 
				
			||||||
									<li>TestAnimation2</li>
 | 
					 | 
				
			||||||
								</animationDefs>
 | 
					 | 
				
			||||||
							</li>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
							<li>
 | 
					 | 
				
			||||||
								<probability>1</probability>
 | 
					 | 
				
			||||||
								<animationDefs>
 | 
					 | 
				
			||||||
									<li>TestAnimation2</li>
 | 
					 | 
				
			||||||
									<li>TestAnimation2</li>
 | 
					 | 
				
			||||||
								</animationDefs>
 | 
					 | 
				
			||||||
							</li>
 | 
					 | 
				
			||||||
						</loopOptions>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
					</li>
 | 
					 | 
				
			||||||
				</paths>
 | 
									</paths>
 | 
				
			||||||
			</li>
 | 
								</li>
 | 
				
			||||||
 | 
								-->
 | 
				
			||||||
 | 
								
 | 
				
			||||||
		</animationStages>
 | 
							</animationStages>
 | 
				
			||||||
		
 | 
								
 | 
				
			||||||
		<contexts>
 | 
							<contexts>
 | 
				
			||||||
			<li Class="Rimworld_Animations.GroupAnimationContext_RJWSex">
 | 
								<li Class="Rimworld_Animations.GroupAnimationContext_RJWSex">
 | 
				
			||||||
				<interactionDefs>
 | 
									<interactionDefs>
 | 
				
			||||||
| 
						 | 
					@ -87,12 +52,11 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			</li>
 | 
								</li>
 | 
				
			||||||
		</contexts>
 | 
							</contexts>
 | 
				
			||||||
		<!--
 | 
					
 | 
				
			||||||
		<OffsetDefs>
 | 
							<offsetDefs>
 | 
				
			||||||
			<li>GroinToAppropriateHeight</li>
 | 
								<li>GroinToAppropriateHeight</li> <!-- first pawn in animation -->
 | 
				
			||||||
			<li>GroinToAppropriateHeight</li>
 | 
								<li>GroinToAppropriateHeight</li> <!-- second pawn in animation -->
 | 
				
			||||||
		</OffsetDefs>
 | 
							</offsetDefs>
 | 
				
			||||||
		
 | 
					
 | 
				
			||||||
		-->
 | 
					 | 
				
			||||||
	</Rimworld_Animations.GroupAnimationDef>
 | 
						</Rimworld_Animations.GroupAnimationDef>
 | 
				
			||||||
</Defs>
 | 
					</Defs>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,38 +1,44 @@
 | 
				
			||||||
<?xml version="1.0" encoding="utf-8" ?>
 | 
					<?xml version="1.0" encoding="utf-8" ?>
 | 
				
			||||||
<Defs>
 | 
					<Defs>
 | 
				
			||||||
	<Rimworld_Animations.OffsetDef>
 | 
						<Rimworld_Animations.AnimationOffsetDef>
 | 
				
			||||||
		<defName>GroinToAppropriateHeight</defName>
 | 
							<defName>GroinToAppropriateHeight</defName>
 | 
				
			||||||
		<bodyTypeOffsets>
 | 
							<offsets>
 | 
				
			||||||
			<li>
 | 
								<li Class="Rimworld_Animations.AnimationOffset_Single">
 | 
				
			||||||
				<bodyType>Male</bodyType>
 | 
									<races>
 | 
				
			||||||
				<offset>(0, 0, 0.5)</offset>
 | 
										<li>Alien_Orassan</li>
 | 
				
			||||||
 | 
									</races>
 | 
				
			||||||
 | 
									<offset>(0, 0, 5)</offset>
 | 
				
			||||||
			</li>
 | 
								</li>
 | 
				
			||||||
		</bodyTypeOffsets>
 | 
					
 | 
				
			||||||
		<raceOffsets>
 | 
								<li Class="Rimworld_Animations.AnimationOffset_BodyType">
 | 
				
			||||||
			<li Class="Rimworld_Animations.RaceOffsets_BodyTypes" MayRequire="erdelf.HumanoidAlienRaces,Minecraft.Mod">
 | 
									<races>
 | 
				
			||||||
				<def>MinecraftCreeper</def>
 | 
										<li>Human</li>
 | 
				
			||||||
				<genderGraphics>
 | 
									</races>
 | 
				
			||||||
					<Female>
 | 
									<offsets>
 | 
				
			||||||
						<Hulk>(0, 0, 0.5)</Hulk>
 | 
										<li><bodyType>Hulk</bodyType><offset>(0, 0, 0.5)</offset></li>
 | 
				
			||||||
						<Thin>(0, 0, 0.3)</Thin>
 | 
										<li><bodyType>Thin</bodyType><offset>(0, 0, 0.3)</offset></li>
 | 
				
			||||||
					</Female>
 | 
										<li><bodyType>Female</bodyType><offset>(0, 0, 0.4)</offset></li>
 | 
				
			||||||
					<Male>
 | 
									</offsets>
 | 
				
			||||||
						<Hulk>(0, 0, 0.5)</Hulk>
 | 
					 | 
				
			||||||
						<Thin>(0, 0, 0.3)</Thin>
 | 
					 | 
				
			||||||
					</Male>
 | 
					 | 
				
			||||||
				</genderGraphics>
 | 
					 | 
				
			||||||
			</li>
 | 
								</li>
 | 
				
			||||||
			<li Class="Rimworld_Animations.RaceOffsets_DifferentBodyTypes" MayRequire="Specific.Mod,Other.Cool.Mod">
 | 
								
 | 
				
			||||||
				<def>MinecraftPig</def>
 | 
								<li Class="Rimworld_Animations.AnimationOffset_BodyTypeGendered" MayRequire="erdelf.HumanoidAlienRaces,Minecraft.Mod">
 | 
				
			||||||
				<bodyType>Male</bodyType>
 | 
									<races>
 | 
				
			||||||
				<offset>(0, 0, -0.5)</offset>
 | 
										<li>MinecraftCreeper</li>
 | 
				
			||||||
 | 
									</races>
 | 
				
			||||||
 | 
									<offsetsMale>
 | 
				
			||||||
 | 
										<li><bodyType>Hulk</bodyType><offset>(0, 0, 0.5)</offset></li>
 | 
				
			||||||
 | 
										<li><bodyType>Male</bodyType><offset>(0, 0, 0.5)</offset></li>
 | 
				
			||||||
 | 
										<li><bodyType>Female</bodyType><offset>(0, 0, 0.5)</offset></li>
 | 
				
			||||||
 | 
										<li><bodyType>Thin</bodyType><offset>(0, 0, 0.3)</offset></li>
 | 
				
			||||||
 | 
									</offsetsMale>
 | 
				
			||||||
 | 
									<offsetsFemale>
 | 
				
			||||||
 | 
										<li><bodyType>Hulk</bodyType><offset>(0, 0, 0.5)</offset></li>
 | 
				
			||||||
 | 
										<li><bodyType>Male</bodyType><offset>(0, 0, 0.5)</offset></li>
 | 
				
			||||||
 | 
										<li><bodyType>Female</bodyType><offset>(0, 0, 0.5)</offset></li>
 | 
				
			||||||
 | 
										<li><bodyType>Thin</bodyType><offset>(0, 0, 0.3)</offset></li>
 | 
				
			||||||
 | 
									</offsetsFemale>
 | 
				
			||||||
			</li>
 | 
								</li>
 | 
				
			||||||
			<li Class="Rimworld_Animations.RaceOffsets_DifferentBodyTypes" MayRequire="Specific.Minecraft.Mod">
 | 
							</offsets>
 | 
				
			||||||
				<def>MinecraftPig</def>
 | 
						</Rimworld_Animations.AnimationOffsetDef>
 | 
				
			||||||
				<bodyType>Female</bodyType>
 | 
					 | 
				
			||||||
				<offset>(0, 0, -0.5)</offset>
 | 
					 | 
				
			||||||
			</li>
 | 
					 | 
				
			||||||
		</raceOffsets>
 | 
					 | 
				
			||||||
	</Rimworld_Animations.OffsetDef>
 | 
					 | 
				
			||||||
</Defs>
 | 
					</Defs>
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,27 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="utf-8" ?>
 | 
				
			||||||
 | 
					<Patch>
 | 
				
			||||||
 | 
						<!-- add offset rendersubworker to all pawn render tree defs -->
 | 
				
			||||||
 | 
						<Operation Class="PatchOperationSequence">
 | 
				
			||||||
 | 
							<success>Always</success>
 | 
				
			||||||
 | 
							<operations>
 | 
				
			||||||
 | 
								<li Class="PatchOperationConditional">
 | 
				
			||||||
 | 
									<xpath>/Defs/PawnRenderTreeDef/root/subworkerClasses</xpath>
 | 
				
			||||||
 | 
									<success>Always</success>
 | 
				
			||||||
 | 
									<nomatch Class="PatchOperationAdd">
 | 
				
			||||||
 | 
										<xpath>/Defs/PawnRenderTreeDef/root</xpath>
 | 
				
			||||||
 | 
										<value>
 | 
				
			||||||
 | 
											<subworkerClasses />
 | 
				
			||||||
 | 
										</value>
 | 
				
			||||||
 | 
									</nomatch>
 | 
				
			||||||
 | 
								</li>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								<li Class="PatchOperationAdd">
 | 
				
			||||||
 | 
									<xpath>/Defs/PawnRenderTreeDef/root/subworkerClasses</xpath>
 | 
				
			||||||
 | 
									<value>
 | 
				
			||||||
 | 
										<li>Rimworld_Animations.PawnRenderSubWorker_ChangeOffset</li>
 | 
				
			||||||
 | 
									</value>
 | 
				
			||||||
 | 
								</li>
 | 
				
			||||||
 | 
							</operations>
 | 
				
			||||||
 | 
						</Operation>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</Patch>
 | 
				
			||||||
| 
						 | 
					@ -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;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										33
									
								
								1.5/Source/Animations/AnimationOffsets/AnimationOffsetDef.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								1.5/Source/Animations/AnimationOffsets/AnimationOffsetDef.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -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<BaseAnimationOffset> 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;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -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<BodyTypeOffset> offsets;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public override Vector3? getOffset(Pawn pawn)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return offsets.Find(x => x.bodyType == pawn.story.bodyType)?.offset;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -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<BodyTypeOffset> offsetsMale;
 | 
				
			||||||
 | 
					        public List<BodyTypeOffset> 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;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -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;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -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<ThingDef> races;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public abstract Vector3? getOffset(Pawn pawn);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool appliesToPawn(Pawn pawn)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return races.Contains(pawn.def);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -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;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -10,7 +10,7 @@ namespace Rimworld_Animations
 | 
				
			||||||
    public class AnimationPropDef : Def
 | 
					    public class AnimationPropDef : Def
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public PawnRenderNodeProperties_GraphicVariants animPropProperties;
 | 
					        public PawnRenderNodeProperties animPropProperties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -18,6 +18,7 @@ namespace Rimworld_Animations
 | 
				
			||||||
        public override Vector3 OffsetAtTick(int tick, PawnDrawParms parms)
 | 
					        public override Vector3 OffsetAtTick(int tick, PawnDrawParms parms)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //Todo: Use this for bodyoffsets
 | 
					            //Todo: Use this for bodyoffsets
 | 
				
			||||||
 | 
					            //or maybe make a rendersubworker for it instead
 | 
				
			||||||
            return base.OffsetAtTick(tick, parms);
 | 
					            return base.OffsetAtTick(tick, parms);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,6 +3,7 @@ using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using UnityEngine;
 | 
				
			||||||
using Verse;
 | 
					using Verse;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Rimworld_Animations
 | 
					namespace Rimworld_Animations
 | 
				
			||||||
| 
						 | 
					@ -12,6 +13,7 @@ namespace Rimworld_Animations
 | 
				
			||||||
        public int numActors;
 | 
					        public int numActors;
 | 
				
			||||||
        public List<AnimationStage> animationStages;
 | 
					        public List<AnimationStage> animationStages;
 | 
				
			||||||
        public List<BaseGroupAnimationContext> contexts;
 | 
					        public List<BaseGroupAnimationContext> contexts;
 | 
				
			||||||
 | 
					        public List<AnimationOffsetDef> offsetDefs;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool canAnimationBeUsed(List<Pawn> actors, out int reorder)
 | 
					        public bool canAnimationBeUsed(List<Pawn> actors, out int reorder)
 | 
				
			||||||
| 
						 | 
					@ -48,5 +50,12 @@ namespace Rimworld_Animations
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return 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);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -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<GroupAnimationDef> paths;
 | 
				
			||||||
 | 
					        public override List<AnimationDef> GetAnimations(int actorNumber, int seed)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            List<AnimationDef> animationDefs = new List<AnimationDef>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            //loop thru the selected groupanimationdef path
 | 
				
			||||||
 | 
					            foreach (AnimationStage stage in paths[(seed * 59) % paths.Count].animationStages)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                animationDefs.AddRange(stage.GetAnimations(actorNumber, seed));
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            return animationDefs;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -19,6 +19,7 @@ namespace Rimworld_Animations {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private List<AnimationDef> animationQueue;
 | 
					        private List<AnimationDef> animationQueue;
 | 
				
			||||||
        private BaseExtendedAnimatorAnchor anchor;
 | 
					        private BaseExtendedAnimatorAnchor anchor;
 | 
				
			||||||
 | 
					        private Vector3? offset;
 | 
				
			||||||
        private bool isAnimating = false;
 | 
					        private bool isAnimating = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
| 
						 | 
					@ -38,12 +39,23 @@ namespace Rimworld_Animations {
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public Vector3? Offset
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                return offset;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            set
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                this.offset = value;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public Vector3 getAnchor()
 | 
					        public Vector3 getAnchor()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            return anchor.getDrawPos();
 | 
					            return anchor.getDrawPos();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
        public override void CompTick()
 | 
					        public override void CompTick()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            if (isAnimating)
 | 
					            if (isAnimating)
 | 
				
			||||||
| 
						 | 
					@ -99,19 +111,21 @@ namespace Rimworld_Animations {
 | 
				
			||||||
            isAnimating = false;
 | 
					            isAnimating = false;
 | 
				
			||||||
            animationQueue = null;
 | 
					            animationQueue = null;
 | 
				
			||||||
            anchor = null;
 | 
					            anchor = null;
 | 
				
			||||||
 | 
					            offset = null;
 | 
				
			||||||
            pawn.Drawer.renderer.SetAnimation(null);
 | 
					            pawn.Drawer.renderer.SetAnimation(null);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void PlayGroupAnimation(List<AnimationDef> groupAnimation)
 | 
					        public void PlayGroupAnimation(List<AnimationDef> groupAnimation, Vector3? offset)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
 | 
					            this.Offset = offset;
 | 
				
			||||||
            animationQueue = groupAnimation;
 | 
					            animationQueue = groupAnimation;
 | 
				
			||||||
            PlayNextAnimation();
 | 
					            PlayNextAnimation();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void PlayGroupAnimation(List<AnimationDef> groupAnimation, BaseExtendedAnimatorAnchor anchor)
 | 
					        public void PlayGroupAnimation(List<AnimationDef> groupAnimation, Vector3? offset, BaseExtendedAnimatorAnchor anchor)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            this.anchor = anchor;
 | 
					            this.anchor = anchor;
 | 
				
			||||||
            PlayGroupAnimation(groupAnimation);
 | 
					            PlayGroupAnimation(groupAnimation, offset);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public override void PostExposeData()
 | 
					        public override void PostExposeData()
 | 
				
			||||||
| 
						 | 
					@ -137,8 +151,16 @@ namespace Rimworld_Animations {
 | 
				
			||||||
                    //if animation makes use of prop,
 | 
					                    //if animation makes use of prop,
 | 
				
			||||||
                    if (AnimationMakesUseOfProp(animationProp))
 | 
					                    if (AnimationMakesUseOfProp(animationProp))
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                        PawnRenderNodeProperties props = animationProp.animPropProperties;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        //create new render node
 | 
					                        //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);
 | 
					                        animRenderNodes.Add(animRenderNode);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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<AnimationStage> paths;
 | 
					 | 
				
			||||||
        public override List<AnimationDef> GetAnimations(int actorNumber, int seed)
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
            return paths[(seed * 59) % paths.Count].GetAnimations(actorNumber, seed);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
| 
						 | 
					@ -5,6 +5,7 @@ using System.Collections.Generic;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
 | 
					using UnityEngine;
 | 
				
			||||||
using Verse;
 | 
					using Verse;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace Rimworld_Animations
 | 
					namespace Rimworld_Animations
 | 
				
			||||||
| 
						 | 
					@ -13,9 +14,11 @@ namespace Rimworld_Animations
 | 
				
			||||||
    [HarmonyPatch(typeof(PawnRenderTree), "TryGetMatrix")]
 | 
					    [HarmonyPatch(typeof(PawnRenderTree), "TryGetMatrix")]
 | 
				
			||||||
    public class HarmonyPatch_PawnRenderTree
 | 
					    public class HarmonyPatch_PawnRenderTree
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        public static void Prefix(PawnRenderTree __instance, Dictionary<PawnRenderNodeTagDef, PawnRenderNode> ___nodesByTag, PawnRenderNode node, ref PawnDrawParms parms)
 | 
					        public static bool Prefix(PawnRenderTree __instance, Dictionary<PawnRenderNodeTagDef, PawnRenderNode> ___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
 | 
					            //find lowest parent that is animating, or nothing if not animating
 | 
				
			||||||
            PawnRenderNode animatingNode = node;
 | 
					            PawnRenderNode animatingNode = node;
 | 
				
			||||||
            while (animatingNode != null
 | 
					            while (animatingNode != null
 | 
				
			||||||
| 
						 | 
					@ -30,6 +33,27 @@ namespace Rimworld_Animations
 | 
				
			||||||
                //change parm to facing to animate correctly
 | 
					                //change parm to facing to animate correctly
 | 
				
			||||||
                parms.facing = animatingNodeAnimationWorker.facingAtTick(__instance.AnimationTick);
 | 
					                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;
 | 
				
			||||||
 | 
					          
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,6 +11,7 @@ namespace Rimworld_Animations
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public List<string> texPathVariants;
 | 
					        public List<string> texPathVariants;
 | 
				
			||||||
 | 
					        public bool absolutePosition = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -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<CompExtendedAnimator>(out CompExtendedAnimator extendedAnimator)
 | 
				
			||||||
 | 
					                && extendedAnimator.IsAnimating)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                Vector3? pawnOffset = extendedAnimator.Offset;
 | 
				
			||||||
 | 
					                if (pawnOffset != null)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    offset += (Vector3)pawnOffset;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -30,20 +30,21 @@ namespace Rimworld_Animations {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            for (int i = 0; i < participants.Count; i++)
 | 
					            for (int i = 0; i < participants.Count; i++)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                Vector3? offset = groupAnimationDef.GetOffset(i, participants[i], reorder);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (anchor is Pawn pawn && pawn == participants[i])
 | 
					                if (anchor is Pawn pawn && pawn == participants[i])
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
 | 
					                    List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
 | 
				
			||||||
                    participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn);
 | 
					                    participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, offset);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    //each participant gets their own unique extendedanimatoranchor, important for scribe_deep saving
 | 
					                    //each participant gets their own unique extendedanimatoranchor, important for scribe_deep saving
 | 
				
			||||||
 | 
					 | 
				
			||||||
                    List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
 | 
					                    List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
 | 
				
			||||||
                    BaseExtendedAnimatorAnchor animatorAnchor = new ExtendedAnimatorAnchor_Thing(anchor);
 | 
					                    BaseExtendedAnimatorAnchor animatorAnchor = new ExtendedAnimatorAnchor_Thing(anchor);
 | 
				
			||||||
 | 
					                    participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, offset, animatorAnchor);
 | 
				
			||||||
                    participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, animatorAnchor);
 | 
					 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -56,7 +57,8 @@ namespace Rimworld_Animations {
 | 
				
			||||||
            for (int i = 0; i < participants.Count; i++)
 | 
					            for (int i = 0; i < participants.Count; i++)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
 | 
					                List<AnimationDef> allAnimationsForPawn = groupAnimationDef.GetAllAnimationsForActor(i, seed, reorder);
 | 
				
			||||||
                participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn);
 | 
					                Vector3? offset = groupAnimationDef.GetOffset(i, participants[i], reorder);
 | 
				
			||||||
 | 
					                participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, offset);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -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());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -38,6 +38,7 @@
 | 
				
			||||||
    </Reference>
 | 
					    </Reference>
 | 
				
			||||||
    <Reference Include="AlienRace">
 | 
					    <Reference Include="AlienRace">
 | 
				
			||||||
      <HintPath>..\..\..\..\..\workshop\content\294100\839005762\1.5\Assemblies\AlienRace.dll</HintPath>
 | 
					      <HintPath>..\..\..\..\..\workshop\content\294100\839005762\1.5\Assemblies\AlienRace.dll</HintPath>
 | 
				
			||||||
 | 
					      <Private>False</Private>
 | 
				
			||||||
    </Reference>
 | 
					    </Reference>
 | 
				
			||||||
    <Reference Include="Assembly-CSharp">
 | 
					    <Reference Include="Assembly-CSharp">
 | 
				
			||||||
      <HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
 | 
					      <HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
 | 
				
			||||||
| 
						 | 
					@ -69,7 +70,12 @@
 | 
				
			||||||
    </Reference>
 | 
					    </Reference>
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <Compile Include="1.5\Source\Patches\Harmony_PatchAll.cs" />
 | 
				
			||||||
    <Compile Include="Properties\AssemblyInfo.cs" />
 | 
					    <Compile Include="Properties\AssemblyInfo.cs" />
 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup>
 | 
				
			||||||
 | 
					    <Content Include="1.5\Assemblies\Patch_HumanoidAlienRaces.dll" />
 | 
				
			||||||
 | 
					  </ItemGroup>
 | 
				
			||||||
 | 
					  <ItemGroup />
 | 
				
			||||||
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 | 
					  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 | 
				
			||||||
</Project>
 | 
					</Project>
 | 
				
			||||||
| 
						 | 
					@ -71,9 +71,14 @@
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <Compile Include="1.5\Source\Actors\Actor.cs" />
 | 
					    <Compile Include="1.5\Source\Actors\Actor.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Actors\AlienRaceOffset.cs" />
 | 
					    <Compile Include="1.5\Source\Actors\AlienRaceOffset.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Actors\BodyTypeOffset.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\AnimationOffsets\AnimationOffsetDef.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\AnimationProps\AnimationPropDef.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\AnimationOffset_BodyType.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\AnimationWorkers\AnimationWorker_KeyframesExtended.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\AnimationOffset_BodyTypeGendered.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\AnimationOffset_Single.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\BaseAnimationOffset.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="1.5\Source\Animations\AnimationOffsets\Offsets\BodyTypeOffset.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="1.5\Source\Animations\AnimationProps\AnimationPropDef.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="1.5\Source\Animations\AnimationWorkers\AnimationWorker_KeyframesExtended.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Comps\CompExtendedAnimator.cs" />
 | 
					    <Compile Include="1.5\Source\Comps\CompExtendedAnimator.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Comps\CompProperties_ExtendedAnimator.cs" />
 | 
					    <Compile Include="1.5\Source\Comps\CompProperties_ExtendedAnimator.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Comps\CompProperties_ThingAnimator.cs" />
 | 
					    <Compile Include="1.5\Source\Comps\CompProperties_ThingAnimator.cs" />
 | 
				
			||||||
| 
						 | 
					@ -82,14 +87,14 @@
 | 
				
			||||||
    <Compile Include="1.5\Source\Comps\ExtendedAnimatorAnchor\ExtendedAnimatorAnchor_Thing.cs" />
 | 
					    <Compile Include="1.5\Source\Comps\ExtendedAnimatorAnchor\ExtendedAnimatorAnchor_Thing.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Comps\ExtendedAnimatorAnchor\ExtendedAnimatorAnchor_Vector3.cs" />
 | 
					    <Compile Include="1.5\Source\Comps\ExtendedAnimatorAnchor\ExtendedAnimatorAnchor_Vector3.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Defs\AnimationDefOf.cs" />
 | 
					    <Compile Include="1.5\Source\Defs\AnimationDefOf.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\GroupAnimations\GroupAnimationContexts\BaseGroupAnimationContext.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationContexts\BaseGroupAnimationContext.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\GroupAnimations\GroupAnimationContexts\GroupAnimationContext_RJWSex.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationContexts\GroupAnimationContext_RJWSex.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\GroupAnimations\GroupAnimationDef.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationDef.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\GroupAnimations\GroupAnimationStages\AnimationStage.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationStages\AnimationStage.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\GroupAnimations\GroupAnimationStages\AnimationStage_Branch.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationStages\AnimationStage_Branch.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\GroupAnimations\GroupAnimationStages\AnimationStage_LoopRandomSelectChance.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationStages\AnimationStage_LoopRandomSelectChance.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\GroupAnimations\GroupAnimationStages\AnimationStage_TicksDuration.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\GroupAnimations\GroupAnimationStages\AnimationStage_TicksDuration.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Keyframes\ExtendedKeyframe.cs" />
 | 
					    <Compile Include="1.5\Source\Animations\Keyframes\ExtendedKeyframe.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\MainTabWindows\MainTabWindow_OffsetConfigure.cs" />
 | 
					    <Compile Include="1.5\Source\MainTabWindows\MainTabWindow_OffsetConfigure.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\MainTabWindows\OffsetMainButtonDefOf.cs" />
 | 
					    <Compile Include="1.5\Source\MainTabWindows\OffsetMainButtonDefOf.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\MainTabWindows\WorldComponent_UpdateMainTab.cs" />
 | 
					    <Compile Include="1.5\Source\MainTabWindows\WorldComponent_UpdateMainTab.cs" />
 | 
				
			||||||
| 
						 | 
					@ -107,9 +112,10 @@
 | 
				
			||||||
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_SexBaseInitiator.cs" />
 | 
					    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_SexBaseInitiator.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\SexBaseReceivers\HarmonyPatch_JobDriver_SexBaseReceiverRaped.cs" />
 | 
					    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\SexBaseReceivers\HarmonyPatch_JobDriver_SexBaseReceiverRaped.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\SexBaseReceivers\HarmonyPatch_JobDriver_SexBaseReceiverLoved.cs" />
 | 
					    <Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\SexBaseReceivers\HarmonyPatch_JobDriver_SexBaseReceiverLoved.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\PawnRenderNode\PawnRenderNodeProperties_GraphicVariants.cs" />
 | 
					    <Compile Include="1.5\Source\PawnRenderNode\GraphicVariants\PawnRenderNodeProperties_GraphicVariants.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\PawnRenderNode\PawnRenderNodeWorker_GraphicVariants.cs" />
 | 
					    <Compile Include="1.5\Source\PawnRenderNode\GraphicVariants\PawnRenderNodeWorker_GraphicVariants.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\PawnRenderNode\PawnRenderNode_GraphicVariants.cs" />
 | 
					    <Compile Include="1.5\Source\PawnRenderNode\GraphicVariants\PawnRenderNode_GraphicVariants.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="1.5\Source\RenderSubWorkers\PawnRenderSubWorker_ChangeOffset.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Settings\AnimationSettings.cs" />
 | 
					    <Compile Include="1.5\Source\Settings\AnimationSettings.cs" />
 | 
				
			||||||
    <Compile Include="1.5\Source\Utilities\AnimationUtility.cs" />
 | 
					    <Compile Include="1.5\Source\Utilities\AnimationUtility.cs" />
 | 
				
			||||||
    <Compile Include="Properties\AssemblyInfo.cs" />
 | 
					    <Compile Include="Properties\AssemblyInfo.cs" />
 | 
				
			||||||
| 
						 | 
					@ -127,6 +133,7 @@
 | 
				
			||||||
    <Content Include="1.5\Defs\SoundDefs\Sounds_Sex.xml" />
 | 
					    <Content Include="1.5\Defs\SoundDefs\Sounds_Sex.xml" />
 | 
				
			||||||
    <Content Include="1.5\Patches\AnimationPatchHSK.xml" />
 | 
					    <Content Include="1.5\Patches\AnimationPatchHSK.xml" />
 | 
				
			||||||
    <Content Include="1.5\Patches\AnimationPatch_CompExtendedAnimator.xml" />
 | 
					    <Content Include="1.5\Patches\AnimationPatch_CompExtendedAnimator.xml" />
 | 
				
			||||||
 | 
					    <Content Include="1.5\Patches\AnimationPatch_PawnRenderTree_OffsetSubWorker.xml" />
 | 
				
			||||||
    <Content Include="1.5\Patches\CompatibilityPatch_FacialAnimation.xml" />
 | 
					    <Content Include="1.5\Patches\CompatibilityPatch_FacialAnimation.xml" />
 | 
				
			||||||
    <Content Include="1.5\Patches\CompatibilityPatch_HCSK.xml" />
 | 
					    <Content Include="1.5\Patches\CompatibilityPatch_HCSK.xml" />
 | 
				
			||||||
    <Content Include="1.5\Patches\CompPatches\AutoCleaner.xml" />
 | 
					    <Content Include="1.5\Patches\CompPatches\AutoCleaner.xml" />
 | 
				
			||||||
| 
						 | 
					@ -178,7 +185,6 @@
 | 
				
			||||||
  <ItemGroup>
 | 
					  <ItemGroup>
 | 
				
			||||||
    <Folder Include="1.5\Source\Extensions\" />
 | 
					    <Folder Include="1.5\Source\Extensions\" />
 | 
				
			||||||
    <Folder Include="1.5\Source\Patches\OtherModPatches\" />
 | 
					    <Folder Include="1.5\Source\Patches\OtherModPatches\" />
 | 
				
			||||||
    <Folder Include="1.5\Source\RenderSubWorkers\" />
 | 
					 | 
				
			||||||
  </ItemGroup>
 | 
					  </ItemGroup>
 | 
				
			||||||
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 | 
					  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 | 
				
			||||||
</Project>
 | 
					</Project>
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue