code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using RimWorld;
using Verse;
using rjw;

namespace Rimworld_Animations {

    [HarmonyPatch(typeof(JobDriver_SexBaseInitiator), "Start")]
    static class HarmonyPatch_JobDriver_SexBaseInitiator_Start {
        public static void Postfix(ref JobDriver_SexBaseInitiator __instance) {
			/*
			 These particular jobs need special code
			 don't play anim for now
			 */
			if(__instance is JobDriver_Masturbate || __instance is JobDriver_ViolateCorpse) {
				return;
			}

			Pawn pawn = __instance.pawn;

			Building_Bed bed = __instance.Bed;

			if ((__instance.Target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever) {

				Pawn Target = __instance.Target as Pawn;

				bool quickie = (__instance is JobDriver_SexQuick) && AnimationSettings.fastAnimForQuickie;

				int preAnimDuration = __instance.duration;
				int AnimationTimeTicks = 0;

				if (bed != null) {
                    RerollAnimations(Target, out AnimationTimeTicks, bed as Thing, __instance.Sexprops.sexType, quickie, sexProps: __instance.Sexprops);
                }
				else {
					RerollAnimations(Target, out AnimationTimeTicks, sexType: __instance.Sexprops.sexType, fastAnimForQuickie: quickie, sexProps: __instance.Sexprops);
				}

				//Modify Orgasm ticks to only orgasm as many times as RJW stock orgasm allows
				if(AnimationTimeTicks != 0)
                {
					__instance.orgasmstick = preAnimDuration * __instance.orgasmstick / AnimationTimeTicks;
				}

			}
		}

		public static void RerollAnimations(Pawn pawn, out int AnimationTimeTicks, Thing bed = null, xxx.rjwSextype sexType = xxx.rjwSextype.None, bool fastAnimForQuickie = false, rjw.SexProps sexProps = null) {

			AnimationTimeTicks = 0;

			if(pawn == null || !(pawn.jobs?.curDriver is JobDriver_SexBaseReciever)) {
				Log.Error("Error: Tried to reroll animations when pawn isn't sexing");
				return;
			}

			List<Pawn> pawnsToAnimate = (pawn.jobs.curDriver as JobDriver_SexBaseReciever).parteners.ToList();

			if (!pawnsToAnimate.Contains(pawn)) {
				pawnsToAnimate = pawnsToAnimate.Append(pawn).ToList();
			}

			for(int i = 0; i < pawnsToAnimate.Count; i++) {

				if(pawnsToAnimate[i].TryGetComp<CompBodyAnimator>() == null) {
					Log.Error("Error: " + pawnsToAnimate[i].Name + " of race " + pawnsToAnimate[i].def.defName + " does not have CompBodyAnimator attached!");
					break;
				}
			}

			AnimationDef anim = AnimationUtility.tryFindAnimation(ref pawnsToAnimate, sexType, sexProps);

			if (anim != null) {

				bool mirror = GenTicks.TicksGame % 2 == 0;

				IntVec3 pos = pawn.Position;

				for (int i = 0; i < anim.actors.Count; i++)
				{
					pawnsToAnimate[i].TryGetComp<CompBodyAnimator>().isAnimating = false;
				}

				for (int i = 0; i < pawnsToAnimate.Count; i++) {

					if (bed != null)
						pawnsToAnimate[i].TryGetComp<CompBodyAnimator>().setAnchor(bed);
					else {

						pawnsToAnimate[i].TryGetComp<CompBodyAnimator>().setAnchor(pos);
					}

					bool shiver = pawnsToAnimate[i].jobs.curDriver is JobDriver_SexBaseRecieverRaped;
					pawnsToAnimate[i].TryGetComp<CompBodyAnimator>().StartAnimation(anim, pawnsToAnimate, i, mirror, shiver, fastAnimForQuickie);

					int animTicks = anim.animationTimeTicks - (fastAnimForQuickie ? anim.animationStages[0].playTimeTicks : 0);
					(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_left = animTicks;
					(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).sex_ticks = animTicks;
					(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).duration = animTicks;

					AnimationTimeTicks = animTicks;

					if(!AnimationSettings.hearts) {
						(pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_between_hearts = Int32.MaxValue;
					}

				}
			}
			else {
				Log.Message("No animation found");

				/*

				//if pawn isn't already animating,
				if (!pawn.TryGetComp<CompBodyAnimator>().isAnimating) {
					(pawn.jobs.curDriver as JobDriver_SexBaseReciever).increase_time(duration);
					//they'll just do the thrusting anim
				}

				*/
			}
		}
	}

	[HarmonyPatch(typeof(JobDriver_SexBaseInitiator), "End")]
	static class HarmonyPatch_JobDriver_SexBaseInitiator_End {

		public static void Postfix(ref JobDriver_SexBaseInitiator __instance) {

			if ((__instance.Target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever) {
				if (__instance.pawn.TryGetComp<CompBodyAnimator>().isAnimating) {

					List<Pawn> parteners = ((__instance.Target as Pawn)?.jobs.curDriver as JobDriver_SexBaseReciever).parteners;

					for (int i = 0; i < parteners.Count; i++) {

						//prevents pawns who started a new anim from stopping their new anim
						if (!((parteners[i].jobs.curDriver as JobDriver_SexBaseInitiator) != null && (parteners[i].jobs.curDriver as JobDriver_SexBaseInitiator).Target != __instance.pawn))
							parteners[i].TryGetComp<CompBodyAnimator>().isAnimating = false;

					}

					__instance.Target.TryGetComp<CompBodyAnimator>().isAnimating = false;

					if (xxx.is_human((__instance.Target as Pawn))) {
						(__instance.Target as Pawn)?.Drawer.renderer.graphics.ResolveApparelGraphics();
						PortraitsCache.SetDirty((__instance.Target as Pawn));
					}
				}

				((__instance.Target as Pawn)?.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Remove(__instance.pawn);

			}

			if (xxx.is_human(__instance.pawn)) {
				__instance.pawn.Drawer.renderer.graphics.ResolveApparelGraphics();
				PortraitsCache.SetDirty(__instance.pawn);
			}
		}
	}
}


code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using RimWorld;
using Verse;
using rjw;
using System.Reflection.Emit;

namespace Rimworld_Animations
{

    [HarmonyPatch(typeof(JobDriver_SexBaseRecieverLoved), "MakeSexToil")]
    public static class HarmonyPatch_JobDriver_SexBaseReceiverLoved
    {

        public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codeInstructions)
        {

            var ins = codeInstructions.ToList();
            for(int i = 0; i < ins.Count; i++)
            {
                if(i + 13 < ins.Count && ins[i + 13].opcode == OpCodes.Call && ins[i + 13].OperandIs(AccessTools.DeclaredMethod(typeof(Toils_LayDown), "LayDown"))) {

                    ins.RemoveRange(i, 14);

                }

                else
                {
                    yield return ins[i];
                }
            }

        }

    }
}

repo_name: OrangeMilk/rimworld

license: unknown


code:
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
using UnityEngine;

namespace Rimworld_Animations
{
    [HarmonyPatch(typeof(PawnRenderer), "DrawHeadHair")]
    public static class HarmonyPatch_HeadHair
    {
        public static void Prefix(ref Vector3 headOffset, ref float angle)
        {

        }

    }
}


code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using RimWorld;
using Verse;
using UnityEngine;
using System.Reflection;
using System.Reflection.Emit;

namespace Rimworld_Animations {

	[HarmonyPatch(typeof(PawnRenderer), "RenderPawnInternal", new Type[]
		{
					typeof(Vector3),
					typeof(float),
					typeof(bool),
					typeof(Rot4),
					typeof(RotDrawMode),
					typeof(PawnRenderFlags)
		}
	)]
	public static class HarmonyPatch_PawnRenderer
	{

		[HarmonyBefore(new string[] { "showhair.kv.rw", "erdelf.HumanoidAlienRaces", "Nals.FacialAnimation" })]
		public static void Prefix(PawnRenderer __instance, ref Vector3 rootLoc, ref float angle, bool renderBody, ref Rot4 bodyFacing, RotDrawMode bodyDrawType, PawnRenderFlags flags)
		{

			if (flags.FlagSet(PawnRenderFlags.Portrait)) return;

			PawnGraphicSet graphics = __instance.graphics;
			Pawn pawn = graphics.pawn;
			CompBodyAnimator bodyAnim = pawn.TryGetComp<CompBodyAnimator>();

			if (bodyAnim != null && bodyAnim.isAnimating && pawn.Map == Find.CurrentMap)
			{
				bodyAnim.animatePawnBody(ref rootLoc, ref angle, ref bodyFacing);

			}

		}

		public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> ins = instructions.ToList();

			for(int i = 0; i < instructions.Count(); i++)
			{

				if (i - 3 >= 0 && ins[i - 3].opcode == OpCodes.Call && ins[i - 3].operand != null && ins[i - 3].OperandIs(AccessTools.DeclaredMethod(typeof(PawnRenderer), "BaseHeadOffsetAt")))
                {

					yield return new CodeInstruction(OpCodes.Ldloca, (object)0);
					yield return new CodeInstruction(OpCodes.Ldloca, (object)7);
					yield return new CodeInstruction(OpCodes.Ldloca, (object)6);
					yield return new CodeInstruction(OpCodes.Ldarga, (object)2);
					yield return new CodeInstruction(OpCodes.Ldarg_0);
					yield return new CodeInstruction(OpCodes.Ldfld, AccessTools.DeclaredField(typeof(PawnRenderer), "pawn"));
					yield return new CodeInstruction(OpCodes.Ldarg, (object)6);
					yield return new CodeInstruction(OpCodes.Call, AccessTools.DeclaredMethod(typeof(AnimationUtility), "AdjustHead"));
					yield return ins[i];
					//headFacing equals true
                }

				else
                {
					yield return ins[i];
				}

			}

		}

	}

}


code:
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace Rimworld_Animations {
    [HarmonyPatch(typeof(Thing), "Rotation", MethodType.Getter)]
    public static class HarmonyPatch_PawnRotation {

        public static bool Prefix(Thing __instance, ref Rot4 __result) {

            if(!(__instance is Pawn) || (__instance as Pawn)?.TryGetComp<CompBodyAnimator>() == null || !(__instance as Pawn).TryGetComp<CompBodyAnimator>().isAnimating) {
                return true;
            }

            Pawn pawn = (__instance as Pawn);
            __result = pawn.TryGetComp<CompBodyAnimator>().bodyFacing;

            return false;

        }

    }

}


code:
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;

namespace Rimworld_Animations {

    [HarmonyPatch(typeof(Pawn_DrawTracker), "DrawPos", MethodType.Getter)]
    public static class HarmonyPatch_Pawn_DrawTracker {
        public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) {

            CompBodyAnimator bodyAnim = ___pawn.TryGetComp<CompBodyAnimator>();

            if (bodyAnim != null && bodyAnim.isAnimating) {
                __result = ___pawn.TryGetComp<CompBodyAnimator>().anchor + ___pawn.TryGetComp<CompBodyAnimator>().deltaPos;

                return false;
            }
            return true;
        }
    }
}


code:
using HarmonyLib;
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
using Verse;

namespace Rimworld_Animations
{
	[HarmonyPatch(typeof(PawnRenderer), "RenderPawnAt")]
	public static class PawnRenderer_RenderPawnAt_Patch
	{
		static bool ClearCache(Pawn pawn)
		{
			return pawn.IsInvisible() || (pawn.TryGetComp<CompBodyAnimator>() != null && pawn.TryGetComp<CompBodyAnimator>().isAnimating);
		}

		public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			var list = instructions.ToList();

			foreach (CodeInstruction i in instructions)
			{
				if (i.OperandIs(AccessTools.Method(typeof(PawnUtility), "IsInvisible")))
				{

					yield return new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(PawnRenderer_RenderPawnAt_Patch), "ClearCache"));
				}
				else
				{
					yield return i;
				}
			}
		}
	}

}


code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using UnityEngine;
using RimWorld;

namespace Rimworld_Animations {

    public class AnimationSettings : ModSettings {

        public static bool orgasmQuiver, rapeShiver, soundOverride = true, hearts = true, controlGenitalRotation = false, applySemenOnAnimationOrgasm = false, fastAnimForQuickie = false;
        public static bool offsetTab = false, debugMode = false;
        public static float shiverIntensity = 2f;

        public static Dictionary<string, Vector2> offsets = new Dictionary<string, Vector2>();
        public static Dictionary<string, float> rotation = new Dictionary<string, float>();

        public override void ExposeData() {

            base.ExposeData();

            Scribe_Values.Look(ref debugMode, "RJWAnimations-AnimsDebugMode", false);
            Scribe_Values.Look(ref offsetTab, "RJWAnimations-EnableOffsetTab", false);
            Scribe_Values.Look(ref controlGenitalRotation, "RJWAnimations-controlGenitalRotation", false);
            Scribe_Values.Look(ref orgasmQuiver, "RJWAnimations-orgasmQuiver");
            Scribe_Values.Look(ref fastAnimForQuickie, "RJWAnimations-fastAnimForQuickie");
            Scribe_Values.Look(ref rapeShiver, "RJWAnimations-rapeShiver");
            Scribe_Values.Look(ref hearts, "RJWAnimation-sheartsOnLovin");
            Scribe_Values.Look(ref applySemenOnAnimationOrgasm, "RJWAnimations-applySemenOnOrgasm", false);
            Scribe_Values.Look(ref soundOverride, "RJWAnimations-rjwAnimSoundOverride", true);
            Scribe_Values.Look(ref shiverIntensity, "RJWAnimations-shiverIntensity", 2f);
            //todo: save offsetsByDefName

            Scribe_Collections.Look(ref offsets, "RJWAnimations-animationOffsets");
            Scribe_Collections.Look(ref rotation, "RJWAnimations-rotationOffsets");

            //needs to be rewritten
            //probably somewhere in options?

        }

    }

    public class RJW_Animations : Mod {

        public RJW_Animations(ModContentPack content) : base(content) {
            GetSettings<AnimationSettings>();

        }

        public override void DoSettingsWindowContents(Rect inRect) {

            Listing_Standard listingStandard = new Listing_Standard();
            listingStandard.Begin(inRect);

            listingStandard.CheckboxLabeled("Enable Sound Override", ref AnimationSettings.soundOverride);
            listingStandard.CheckboxLabeled("Control Genital Rotation", ref AnimationSettings.controlGenitalRotation);
            listingStandard.CheckboxLabeled("Play Fast Animation for Quickie", ref AnimationSettings.fastAnimForQuickie);
            listingStandard.CheckboxLabeled("Apply Semen on Animation Orgasm", ref AnimationSettings.applySemenOnAnimationOrgasm);

            if(AnimationSettings.applySemenOnAnimationOrgasm) {
                listingStandard.Label("Recommended--turn down \"Cum on body percent\" in RJW settings to about 33%");
            }

            listingStandard.CheckboxLabeled("Enable Orgasm Quiver", ref AnimationSettings.orgasmQuiver);
            listingStandard.CheckboxLabeled("Enable Rape Shiver", ref AnimationSettings.rapeShiver);
            listingStandard.CheckboxLabeled("Enable hearts during lovin'", ref AnimationSettings.hearts);

            listingStandard.CheckboxLabeled("Enable Animation Manager Tab", ref AnimationSettings.offsetTab);

            listingStandard.Label("Shiver/Quiver Intensity (default 2): " + AnimationSettings.shiverIntensity);
            AnimationSettings.shiverIntensity = listingStandard.Slider(AnimationSettings.shiverIntensity, 0.0f, 12f);

            listingStandard.CheckboxLabeled("Debug Mode", ref AnimationSettings.debugMode);

            listingStandard.End();
            base.DoSettingsWindowContents(inRect);
        }

        public override void WriteSettings() {
            base.WriteSettings();
            OffsetMainButtonDefOf.OffsetManager.buttonVisible = AnimationSettings.offsetTab;

        }

        public override string SettingsCategory() {
            return "RJW Animation Settings";
        }
    }
}


code:
<?xml version="1.0" encoding="utf-8"?>

<ModMetaData>
	<name>Rimworld-Animations</name>
	<author>C0ffee</author>
  <url>https://gitgud.io/c0ffeeeeeeee/rimworld-animations</url>
	<supportedVersions>

1.1

1.2

1.3

	</supportedVersions>
	<packageId>c0ffee.rimworld.animations</packageId>
	<modDependencies>

			<packageId>brrainz.harmony</packageId>
			<displayName>Harmony</displayName>
			<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
			<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>

			<packageId>UnlimitedHugs.HugsLib</packageId>
			<displayName>HugsLib</displayName>
			<downloadUrl>https://github.com/UnlimitedHugs/RimworldHugsLib/releases/latest</downloadUrl>
			<steamWorkshopUrl>steam://url/CommunityFilePage/818773962</steamWorkshopUrl>

			<packageId>rim.job.world</packageId>
			<displayName>RimJobWorld</displayName>
			<downloadUrl>https://www.loverslab.com/topic/110270-mod-rimjobworld/</downloadUrl>

			<packageId>erdelf.HumanoidAlienRaces</packageId>
			<displayName>Humanoid Alien Races 2.0</displayName>
			<steamWorkshopUrl>https://steamcommunity.com/sharedfiles/filedetails/?id=839005762</steamWorkshopUrl>

	</modDependencies>
	<loadAfter>

UnlimitedHugs.HugsLib

brrainz.harmony

erdelf.humanoidalienraces

nals.facialanimation

com.yayo.yayoAni

	</loadAfter>
	<loadBefore>
	</loadBefore>
	<incompatibleWith>

velc.HatsDisplaySelection

	</incompatibleWith>
	<description>
    Rimworld Animations! Hurray!

    Questions or bugs?
    Chat with me on the forums: https://www.loverslab.com/topic/140386-rjw-animations/
    Or on the rjw discord: https://discord.gg/CXwHhv8

  </description>
</ModMetaData>


code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest>
  <identifier>Rimworld-Animations</identifier>
  <version>1.2.3</version>
</Manifest>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <OffsetManager.label>gerenciador de posições</OffsetManager.label>
  <OffsetManager.description>Controla as posições sexuais dos colonos.</OffsetManager.description>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <Dog_Doggystyle.label>estilo cachorrinho</Dog_Doggystyle.label>
  <Horse_Cowgirl.label>vaqueira</Horse_Cowgirl.label>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <Tribadism.label>tribadismo</Tribadism.label>
  <Cunnilingus.label>cunilíngua</Cunnilingus.label>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <Double_Penetration.label>dupla penetração</Double_Penetration.label>

</LanguageData>


code:
<?xml version="1.0" encoding="utf-8"?>
<LanguageData>

  <Doggystyle.label>estilo cachorrinho</Doggystyle.label>
  <Blowjob.label>boquete</Blowjob.label>
  <ReverseStandAndCarry.label>69</ReverseStandAndCarry.label>
  <Cowgirl.label>vaqueira</Cowgirl.label>

</LanguageData>


code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<loadFolders>
	<v1.1>

/

1.1

	</v1.1>
	<v1.2>

/

1.2

Patch_HatsDisplaySelection/1.2

	</v1.2>
	<v1.3>

/

1.3

Patch_HatsDisplaySelection/1.2

	</v1.3>

</loadFolders>


code:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Rimworld-Animations")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Rimworld-Animations")]
[assembly: AssemblyCopyright("Copyright ©  2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("71b05d71-67b2-4014-82cd-18c20ac0882f")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]


code:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{71B05D71-67B2-4014-82CD-18C20AC0882F}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Rimworld_Animations</RootNamespace>
    <AssemblyName>Rimworld-Animations</AssemblyName>
    <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
    <Deterministic>true</Deterministic>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>false</DebugSymbols>
    <DebugType>none</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>1.3\Assemblies\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>none</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="0Harmony">
      <HintPath>..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="AlienRace">
      <HintPath>..\..\..\..\workshop\content\294100\839005762\1.3\Assemblies\AlienRace.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Assembly-CSharp">
      <HintPath>..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="RJW">
      <HintPath>..\rjw\1.3\Assemblies\RJW.dll</HintPath>
    </Reference>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.Xml" />
    <Reference Include="UnityEngine">
      <HintPath>..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="UnityEngine.CoreModule">
      <HintPath>..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
      <Private>False</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Properties\AssemblyInfo.cs" />
    <Compile Include="1.3\Source\Actors\Actor.cs" />
    <Compile Include="1.3\Source\Actors\AlienRaceOffset.cs" />
    <Compile Include="1.3\Source\Actors\BodyTypeOffset.cs" />
    <Compile Include="1.3\Source\Animations\AnimationStage.cs" />
    <Compile Include="1.3\Source\Animations\Clips\BaseAnimationClip.cs" />
    <Compile Include="1.3\Source\Animations\Clips\PawnAnimationClip.cs" />
    <Compile Include="1.3\Source\Animations\Clips\ThingAnimationClip.cs" />
    <Compile Include="1.3\Source\Animations\Keyframes\Keyframe.cs" />
    <Compile Include="1.3\Source\Animations\Keyframes\PawnKeyframe.cs" />
    <Compile Include="1.3\Source\Animations\Keyframes\ThingKeyframe.cs" />
    <Compile Include="1.3\Source\AnimationUtility.cs" />
    <Compile Include="1.3\Source\Comps\CompBodyAnimator.cs" />
    <Compile Include="1.3\Source\Comps\CompProperties_BodyAnimator.cs" />
    <Compile Include="1.3\Source\Comps\CompProperties_ThingAnimator.cs" />
    <Compile Include="1.3\Source\Comps\CompThingAnimator.cs" />
    <Compile Include="1.3\Source\Defs\AnimationDef.cs" />
    <Compile Include="1.3\Source\MainTabWindows\WorldComponent_UpdateMainTab.cs" />
    <Compile Include="1.3\Source\MainTabWindows\MainTabWindow_OffsetConfigure.cs" />
    <Compile Include="1.3\Source\MainTabWindows\OffsetMainButtonDefOf.cs" />
    <Compile Include="1.3\Source\Patches\OtherModPatches\HarmonyPatch_AlienRace.cs" />
    <Compile Include="1.3\Source\Patches\OtherModPatches\HarmonyPatch_CSL.cs" />
    <Compile Include="1.3\Source\Patches\OtherModPatches\HarmonyPatch_DontShaveYourHead.cs" />
    <Compile Include="1.3\Source\Patches\OtherModPatches\HarmonyPatch_FacialAnimation.cs" />
    <Compile Include="1.3\Source\Patches\OtherModPatches\HarmonyPatch_HatsDisplaySelection.cs" />
    <Compile Include="1.3\Source\Patches\OtherModPatches\HarmonyPatch_ShowHairWithHats.cs" />
    <Compile Include="1.3\Source\Patches\RimworldPatches\HarmonyPatch_HeadHair.cs" />
    <Compile Include="1.3\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderer.cs" />
    <Compile Include="1.3\Source\Patches\RimworldPatches\HarmonyPatch_PawnRotation.cs" />
    <Compile Include="1.3\Source\Patches\RimworldPatches\HarmonyPatch_Pawn_DrawTracker.cs" />
    <Compile Include="1.3\Source\Patches\RimworldPatches\HarmonyPatch_SetPawnAnimatable.cs" />
    <Compile Include="1.3\Source\Patches\Harmony_PatchAll.cs" />
    <Compile Include="1.3\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_JoinInBed.cs" />
    <Compile Include="1.3\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_SexBaseInitiator.cs" />
    <Compile Include="1.3\Source\Patches\RJWPatches\HarmonyPatch_PlaySexSounds.cs" />
    <Compile Include="1.3\Source\Patches\RJWPatches\HarmonyPatch_SexTick.cs" />
    <Compile Include="1.3\Source\Patches\RJWPatches\HarmonyPatch_WorkGiverSex.cs" />
    <Compile Include="1.3\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_SexBaseReceiverLoved.cs" />
    <Compile Include="1.3\Source\Settings\AnimationSettings.cs" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="1.1\Assemblies\Rimworld-Animations.dll" />
    <Content Include="1.3\Assemblies\Rimworld-Animations.dll" />
    <Content Include="About\About.xml" />
    <Content Include="About\Manifest.xml" />
    <Content Include="1.3\Defs\AnimationDefs\Animations_Beast.xml" />
    <Content Include="1.3\Defs\AnimationDefs\Animations_Lesbian.xml" />
    <Content Include="1.3\Defs\AnimationDefs\Animations_Masturbate.xml" />
    <Content Include="1.3\Defs\AnimationDefs\Animations_Multi.xml" />
    <Content Include="1.3\Defs\AnimationDefs\Animations_vanilla.xml" />
    <Content Include="1.3\Defs\AnimationDefs\Animations_Vanilla2.xml" />
    <Content Include="1.3\Defs\MainTabDefs\MainButtonDef.xml" />
    <Content Include="1.3\Defs\SoundDefs\Sounds_Sex.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\MainButtonDef\MainButtonDef.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\Rimworld_Animations.AnimationDef\Animations_Beast.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\Rimworld_Animations.AnimationDef\Animations_Lesbian.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\Rimworld_Animations.AnimationDef\Animations_Multi.xml" />
    <Content Include="Languages\PortugueseBrazilian\DefInjected\Rimworld_Animations.AnimationDef\Animations_vanilla.xml" />
    <Content Include="LoadFolders.xml" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="1.2\" />
    <Folder Include="1.3\Defs\JobDefs\" />
    <Folder Include="1.3\Source\JobDrivers\" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>


code:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29905.134
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rimworld-Animations", "Rimworld-Animations.csproj", "{71B05D71-67B2-4014-82CD-18C20AC0882F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Patch_HatsDisplaySelection", "Patch_HatsDisplaySelection\Patch_HatsDisplaySelection.csproj", "{BA766964-1716-422D-A09E-29426F8EB9D5}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{71B05D71-67B2-4014-82CD-18C20AC0882F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{71B05D71-67B2-4014-82CD-18C20AC0882F}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{71B05D71-67B2-4014-82CD-18C20AC0882F}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{71B05D71-67B2-4014-82CD-18C20AC0882F}.Release|Any CPU.Build.0 = Release|Any CPU
		{BA766964-1716-422D-A09E-29426F8EB9D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{BA766964-1716-422D-A09E-29426F8EB9D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{BA766964-1716-422D-A09E-29426F8EB9D5}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {7E01292A-D76F-4CA3-AA64-085B84ECD905}
	EndGlobalSection
EndGlobal


code:
**/mousetrap.js
**/pako.js
**/sugarCubeConfig.js
**/format.js
**/displayVariables.js
**/dTree.min.js
**/optionsMacro.js
temp.**
**.temp
**/001-lib
/build/**/*
/devNotes/legacy files/**/*
bin/*

repo_name: Arkerthan/fc

path: .eslintignore

license: mit


code:
{
	"root": true,
	"env": {
		"browser": true,
		"es6": true,
		"jquery": true
	},
	"extends": ["eslint:recommended"],
	"plugins": [
		"jsdoc",
		"sonarjs"
	],
	"globals": {
		"SugarCube": false,
		"Config": false,
		"State": false,
		"Story": false,
		"settings": false,
		"setup": false,
		"App": false,
		"prehistory": true,
		"predisplay": true,
		"prerender": true,
		"postrender": true,
		"postdisplay": true
	},
	"parserOptions": {
		"ecmaVersion": 2021,
		"sourceType": "script",
		"ecmaFeatures": {
			"impliedStrict": true
		}
	},
	"overrides": [
		{
			// overrides for helper scripts that are written
			// using imports and/or exports
			"files": ["gulpfile.js", "devTools/scripts/*.js"],
			"parserOptions": {
				"sourceType": "module",
				"ecmaVersion": 2022
			}
		}
	],
	"settings": {
		"jsdoc": {
			"mode": "typescript"
		}
	},
	"rules": {
		"no-prototype-builtins": "off",
		"semi": ["warn", "always"],
		"semi-spacing": "warn",
		"semi-style": "warn",
		"block-spacing": ["warn", "always"],
		"curly": ["warn", "all"],
		"eqeqeq": ["warn", "smart"],
		"space-before-function-paren": ["warn", {
			"anonymous": "never",
			"named": "never",
			"asyncArrow": "always"
		}],
		"template-curly-spacing": ["warn", "never"],
		"no-trailing-spaces": "warn",
		"no-mixed-spaces-and-tabs": ["warn", "smart-tabs"],
		"no-unneeded-ternary": "warn",
		"camelcase": "warn",
		"padded-blocks": ["warn", "never"],
		"comma-spacing": "warn",
		"comma-style": "warn",
		"object-curly-newline": ["warn",
			{
				"ObjectExpression":{
					"minProperties": 4,
					"consistent": true
				},
				"ImportDeclaration": {
					"minProperties": 4,
					"consistent": true
				},
				"ExportDeclaration": {
					"minProperties": 4,
					"consistent": true
				},
				"ObjectPattern": {
					"minProperties": 8,
					"consistent": true
				}
			}
		],
		"object-curly-spacing": "warn",
		"no-var": "warn",
		"spaced-comment": "warn",
		"no-undef": "off",
		"indent": ["error", "tab", { "SwitchCase": 1 }],
		"no-unused-vars": ["error", {"args": "none"}],
		"no-unused-expressions": "error",
		"block-scoped-var": "error",
		"dot-notation": "warn",
		"eol-last": "warn",
		"unicode-bom": [
			"error",
			"never"
		],
		"brace-style": [
			"warn",
			"1tbs",
			{
				"allowSingleLine": true
			}
		],
		"no-sequences": "warn",
		"no-unreachable-loop": "warn",
		"generator-star-spacing": [
			"warn",
			{
				"before": false,
				"after": true,
				"anonymous": "neither"
			}
		],
		"one-var": ["warn", "never"],
		"keyword-spacing": "warn",
		"no-template-curly-in-string": "error",
		"operator-linebreak": ["warn", "after", { "overrides": { "?": "before", ":": "before" }}],
		"jsdoc/check-alignment": 1,
		"jsdoc/check-examples": 0, // interferes with SugarCube examples
		"jsdoc/check-indentation": 0,
		"jsdoc/check-param-names": 1,
		"jsdoc/check-property-names": 1,
		"jsdoc/check-syntax": 1,
		"jsdoc/check-tag-names": 1,
		"jsdoc/check-types": 1,
		"jsdoc/implements-on-classes": 1,
		"jsdoc/match-description": 0, // rejects SugarCube syntax
		"jsdoc/newline-after-description": 0,
		"jsdoc/no-types": 0,
		"jsdoc/no-undefined-types": 0,
		"jsdoc/require-jsdoc": 0,
		"jsdoc/require-param": 0,
		"jsdoc/require-param-description": 0,
		"jsdoc/require-param-name": 1,
		"jsdoc/require-param-type": 1,
		"jsdoc/require-returns": 0,
		"jsdoc/require-returns-check": 1,
		"jsdoc/require-returns-description": 0,
		"jsdoc/require-returns-type": 1,
		"jsdoc/valid-types": 1,
		"sonarjs/no-all-duplicated-branches": "error",
		"sonarjs/no-element-overwrite": "error",
		"sonarjs/no-extra-arguments": "error",
		"sonarjs/no-identical-conditions": "error",
		"sonarjs/no-identical-expressions": "error",
		"sonarjs/no-one-iteration-loop": "error",
		"sonarjs/no-use-of-empty-return-value": "error",
		"sonarjs/no-collection-size-mischeck": "warn",
		"sonarjs/no-same-line-conditional": "warn",
		"sonarjs/no-unused-collection": "warn"
	}
}


code:
*.bat	text eol=crlf
*.js	text eol=lf
*.tw	text eol=lf
*.sh	text eol=lf
*.py	text eol=lf
*.txt	text eol=lf

path: .gitattributes


code:
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Vim stuff
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
Session.vim
Sessionx.vim
.netrwhist
*~
tags
[._]*.un~

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Start.tw
src/002-config/start.tw

# eslint
node_modules
package-lock.json
yarn.lock
pnpm-lock.yaml

# Visual Studio Code
.vscode/settings.json
.vscode/tasks.json
*.code-workspace

# WebStorm
.idea

# Gulp
build/

# backup
*.bak
*.gho
*.ori
*.orig
*.tmp

# misc
fc-pregmod
bin/*
*.outline
*.todo
TODO.txt
temp.*
*.temp
src/002-config/fc-version.js.commitHash.js
devTools/scripts/.package.json.diff
/settings.json
.eslintcache

# macOS devices
*.icloud

# legacy
devNotes/legacy files/*
/.vs

# mod development
/mods/dev/

# cSpell
.cspellcache

path: .gitignore


code:
workflow:
  rules:
    # only run when on the main repo
    - if: '$CI_PROJECT_ID == "3528"'
      when: always

.official-releases:
  rules:
    - if: $CI_COMMIT_TAG =~ /\A\d+\.\d+\.\d+/

stages:
  - build
  - upload
  - release

variables:
  FC_PREGMOD_ARCHIVE: "FC_pregmod_${CI_COMMIT_TAG}.zip"
  # precompiled / assets
  # the URLs are the same as inside the game, change both if updating
  WEBGL_NAME: "WebGL art assets"
  WEBGL_URL: "https://mega.nz/folder/CgRiQaxS#Cjok57jXZwQt-jP7zkRh2Q"
  RENDER_NAME: "Rendered imagepack (outdated)"
  RENDER_URL: "https://mega.nz/file/upoAlBaZ#EbZ5wCixxZxBhMN_ireJTXt0SIPOywO2JW9XzTIPhe0"

build:
  stage: build
  image: ggcr.io/pregmodfan/fc-pregmod/build
  cache:
    paths:
      - node_modules/
  rules:
    # official release
    - if: $CI_COMMIT_TAG =~ /\A\d+\.\d+\.\d+/
    # latest
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
  before_script:
    - npm update --no-audit --no-fund --omit=dev
  script:
    - npx gulp html --minify --release --ci
  artifacts:
    paths:
      - bin/FC_pregmod.html

upload:
  stage: upload
  image: ggcr.io/pregmodfan/fc-pregmod:megacmd
  extends: .official-releases
  script:
    - mega-login $MEGA_MAIL $MEGA_PWD
    - zip bin/$FC_PREGMOD_ARCHIVE bin/FC_pregmod.html
    - mega-put bin/$FC_PREGMOD_ARCHIVE /
    - echo "MEGA_URL=$(mega-export -a /$FC_PREGMOD_ARCHIVE | grep -o https.*)" >> variables.env
  artifacts:
    # carry MEGA_URL over to the release job
    reports:
      dotenv: variables.env

release:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  extends: .official-releases
  script:
    # extract changes from changelog
    # get line of version header + 1
    - START=$(awk 'match($1,"##") && match($2,v){print NR+1; exit}' v="0.10.7.1-$CI_COMMIT_TAG" CHANGELOG.md)
    # drop everything above the release including the release header
    - tail -n +$START CHANGELOG.md > tmp
    # get line of next version header - 1
    - END=$(awk 'match($1,"##") && match($2,v){print NR-1; exit}' v="0.10.7.1" tmp)
    # drop everything after current release
    - DESCRIPTION=$(head -n $END tmp)
    # create release
    # assets are displayed in inverse order to how they are defined here
    - |
      release-cli create --name "$CI_COMMIT_TAG" --description "$DESCRIPTION" \
        --tag-name "$CI_COMMIT_TAG" \
        --assets-link "{\"name\":\"${RENDER_NAME}\",\"url\":\"${RENDER_URL}\"}" \
        --assets-link "{\"name\":\"${WEBGL_NAME}\",\"url\":\"${WEBGL_URL}\"}" \
        --assets-link "{\"name\":\"${FC_PREGMOD_ARCHIVE}\",\"url\":\"${MEGA_URL}\"}"


code:
/label ~Bug

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->

## Current Behavior
<!-- If describing a bug, tell us what happens instead of the expected behavior. Provide a Screenshots if possible. -->

## Steps to Reproduce
<!-- Provide an unambiguous sequence of steps to reproduce the bug. -->
1.
2.
3.
4.

## Additional information
<!-- Release ID and commit can be found on the starting splash screen or the options page. -->
* Release ID:
* Commit: (if available)
* Save file


code:
/label ~Feature

### Is your proposal related to a problem?
<!--
  Provide a clear and concise description of what the problem is.
  For example, "I'm always frustrated when..."
-->

### Describe the solution you'd like
<!--
  Provide a clear and concise description of what you want to happen.
-->

### Describe alternatives you've considered
<!--
  Let us know about other solutions you've tried or researched.
-->

### Additional context
<!--
  Is there anything else you can add about the proposal?
  You might want to link to related issues here, if you haven't already.
-->


code:
/label ~Question

<!-- Make sure to read the ingame encyclopedia before asking your question -->


code:
[submodule "submodules/sugarcube-2"]
	path = submodules/sugarcube-2
	url = https://gitgud.io/Arkerthan/sugarcube-2.git
	branch = fc

path: .gitmodules


brace_style: collapse,preserve-inline

path: .jsbeautifyrc


code:
// Minified files
**/dTree.min.js
**/js/displayVariables.js

path: .jshintignore