diff --git a/1.2/Assemblies/Rimworld-Animations.dll b/1.2/Assemblies/Rimworld-Animations.dll index e414570..c34b8a1 100644 Binary files a/1.2/Assemblies/Rimworld-Animations.dll and b/1.2/Assemblies/Rimworld-Animations.dll differ diff --git a/Source/AnimationUtility.cs b/Source/AnimationUtility.cs index 104856c..29940d3 100644 --- a/Source/AnimationUtility.cs +++ b/Source/AnimationUtility.cs @@ -44,18 +44,16 @@ namespace Rimworld_Animations { } if ((x.actors[i].blacklistedRaces != null) && x.actors[i].blacklistedRaces.Contains(localParticipants[i].def.defName)) { - if (rjw.RJWSettings.DevMode) { + if(AnimationSettings.debugMode) Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " is blacklisted"); - } return false; } if(x.actors[i].defNames.Contains("Human")) { if (!rjw.xxx.is_human(localParticipants[i])) { - if(rjw.RJWSettings.DevMode) { + if (AnimationSettings.debugMode) Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " is not human"); - } - + return false; } @@ -69,7 +67,8 @@ namespace Rimworld_Animations { foreach(String defname in x.actors[i].defNames) { animInfo += defname + ", "; } - Log.Message(animInfo); + if (AnimationSettings.debugMode) + Log.Message(animInfo); } return false; @@ -80,7 +79,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("Vagina")) { if (!rjw.Genital_Helper.has_vagina(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have vagina"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have vagina"); return false; } @@ -89,7 +89,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("Penis")) { if (!(rjw.Genital_Helper.has_multipenis(localParticipants[i]) || rjw.Genital_Helper.has_penis_infertile(localParticipants[i]) || rjw.Genital_Helper.has_penis_fertile(localParticipants[i]))) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have penis"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have penis"); return false; } @@ -98,7 +99,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("Mouth")) { if (!rjw.Genital_Helper.has_mouth(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have mouth"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have mouth"); return false; } @@ -107,7 +109,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("Anus")) { if (!rjw.Genital_Helper.has_anus(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have anus"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have anus"); return false; } @@ -115,7 +118,8 @@ namespace Rimworld_Animations { if(x.actors[i].requiredGenitals.Contains("Breasts")) { if (!rjw.Genital_Helper.can_do_breastjob(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have breasts"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " doesn't have breasts"); return false; } } @@ -123,7 +127,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("NoVagina")) { if (rjw.Genital_Helper.has_vagina(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has vagina"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has vagina"); return false; } @@ -132,7 +137,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("NoPenis")) { if ((rjw.Genital_Helper.has_multipenis(localParticipants[i]) || rjw.Genital_Helper.has_penis_infertile(localParticipants[i]) || rjw.Genital_Helper.has_penis_fertile(localParticipants[i]))) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has penis"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has penis"); return false; } @@ -141,7 +147,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("NoMouth")) { if (rjw.Genital_Helper.has_mouth(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has mouth"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has mouth"); return false; } @@ -150,7 +157,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("NoAnus")) { if (rjw.Genital_Helper.has_anus(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has anus"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has anus"); return false; } @@ -158,7 +166,8 @@ namespace Rimworld_Animations { if (x.actors[i].requiredGenitals.Contains("NoBreasts")) { if (rjw.Genital_Helper.can_do_breastjob(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has breasts"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has breasts"); return false; } } @@ -174,12 +183,14 @@ namespace Rimworld_Animations { if (x.actors[i].isFucking && !rjw.xxx.can_fuck(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " can't fuck"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " can't fuck"); return false; } if (x.actors[i].isFucked && !rjw.xxx.can_be_fucked(localParticipants[i])) { - Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " can't be fucked"); + if (AnimationSettings.debugMode) + Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " can't be fucked"); return false; } } @@ -229,21 +240,25 @@ namespace Rimworld_Animations { if (optionsWithSexTypeAndInitiator.Any()) { - Log.Message("Selecting animation for rjwSexType " + sexType.ToStringSafe() + " and initiators..."); + if (AnimationSettings.debugMode) + Log.Message("Selecting animation for rjwSexType " + sexType.ToStringSafe() + " and initiators..."); return optionsWithSexType.RandomElement(); } if (optionsWithSexType.Any()) { - Log.Message("Selecting animation for rjwSexType " + sexType.ToStringSafe() + "..."); + if (AnimationSettings.debugMode) + Log.Message("Selecting animation for rjwSexType " + sexType.ToStringSafe() + "..."); return optionsWithSexType.RandomElement(); } if(optionsWithInitiator.Any()) { - Log.Message("Selecting animation for initiators..."); + if (AnimationSettings.debugMode) + Log.Message("Selecting animation for initiators..."); } if (options != null && options.Any()) { - Log.Message("Randomly selecting animation..."); + if (AnimationSettings.debugMode) + Log.Message("Randomly selecting animation..."); return options.RandomElement(); } else diff --git a/Source/MainTabWindows/MainTabWindow_OffsetConfigure.cs b/Source/MainTabWindows/MainTabWindow_OffsetConfigure.cs index ab2a354..fdc1370 100644 --- a/Source/MainTabWindows/MainTabWindow_OffsetConfigure.cs +++ b/Source/MainTabWindows/MainTabWindow_OffsetConfigure.cs @@ -98,12 +98,14 @@ namespace Rimworld_Animations { public override void PreOpen() { base.PreOpen(); if(AnimationSettings.offsets == null) { - Log.Message("New offsets"); + if (AnimationSettings.debugMode) + Log.Message("New offsets"); AnimationSettings.offsets = new Dictionary(); } if(AnimationSettings.rotation == null) { - Log.Message("New rotation"); + if (AnimationSettings.debugMode) + Log.Message("New rotation"); AnimationSettings.rotation = new Dictionary(); } } diff --git a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs index 04cdef2..3b2686d 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs @@ -64,7 +64,7 @@ namespace Rimworld_Animations { public static void RerollAnimations(Pawn pawn, int duration, Thing bed = null, xxx.rjwSextype sexType = xxx.rjwSextype.None, bool fastAnimForQuickie = false, rjw.SexProps sexProps = null) { if(pawn == null || !(pawn.jobs?.curDriver is JobDriver_SexBaseReciever)) { - Log.Message("Error: Tried to reroll animations when pawn isn't sexing"); + Log.Error("Error: Tried to reroll animations when pawn isn't sexing"); return; } @@ -80,7 +80,7 @@ namespace Rimworld_Animations { bool mirror = GenTicks.TicksGame % 2 == 0; - Log.Message("Now playing " + anim.defName + (mirror ? " mirrored" : "")); + Log.Message("Now playing " + anim.defName + (AnimationSettings.debugMode && mirror ? " mirrored" : "")); IntVec3 pos = pawn.Position; @@ -106,7 +106,7 @@ namespace Rimworld_Animations { } } else { - Log.Message("Anim not found"); + Log.Message("No animation found"); //if pawn isn't already animating, if (!pawn.TryGetComp().isAnimating) { (pawn.jobs.curDriver as JobDriver_SexBaseReciever).increase_time(duration); diff --git a/Source/Patches/rjwPatches/HarmonyPatch_PlayAnimJoinInBedRMB.cs b/Source/Patches/rjwPatches/HarmonyPatch_PlayAnimJoinInBedRMB.cs index aab9e41..5fa4cd8 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_PlayAnimJoinInBedRMB.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_PlayAnimJoinInBedRMB.cs @@ -15,7 +15,8 @@ namespace Rimworld_Animations { class HarmonyPatch_PlayAnimJoinInBedRMB { public static void Prefix(ref Job job) { if(job.def == xxx.casual_sex) { - Log.Message("Replacing vanilla RJW JoinInBed JobDriver for animation JobDriver"); + if (AnimationSettings.debugMode || RJWSettings.DevMode) + Log.Message("Replacing vanilla RJW JoinInBed JobDriver for animation JobDriver"); job = new Job(DefDatabase.GetNamed("JoinInBedAnimation", true), job.targetA, job.targetB, job.targetC); } diff --git a/Source/Settings/AnimationSettings.cs b/Source/Settings/AnimationSettings.cs index 75308b8..eec6a7c 100644 --- a/Source/Settings/AnimationSettings.cs +++ b/Source/Settings/AnimationSettings.cs @@ -12,7 +12,7 @@ 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; + public static bool offsetTab = false, debugMode = false; public static float shiverIntensity = 2f; public static Dictionary offsets = new Dictionary(); @@ -22,6 +22,7 @@ namespace Rimworld_Animations { base.ExposeData(); + Scribe_Values.Look(ref debugMode, "AnimsDebugMode", false); Scribe_Values.Look(ref offsetTab, "EnableOffsetTab", false); Scribe_Values.Look(ref controlGenitalRotation, "controlGenitalRotation", false); Scribe_Values.Look(ref orgasmQuiver, "orgasmQuiver"); @@ -75,6 +76,8 @@ namespace Rimworld_Animations { 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);