debug mode to stop spamming log

This commit is contained in:
c0ffeeeeeeee 2020-08-28 00:24:55 -07:00
parent c872e33a65
commit 6ab4a43498
6 changed files with 50 additions and 29 deletions

View file

@ -44,18 +44,16 @@ namespace Rimworld_Animations {
} }
if ((x.actors[i].blacklistedRaces != null) && x.actors[i].blacklistedRaces.Contains(localParticipants[i].def.defName)) { 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"); Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " is blacklisted");
}
return false; return false;
} }
if(x.actors[i].defNames.Contains("Human")) { if(x.actors[i].defNames.Contains("Human")) {
if (!rjw.xxx.is_human(localParticipants[i])) { 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"); Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " is not human");
}
return false; return false;
} }
@ -69,7 +67,8 @@ namespace Rimworld_Animations {
foreach(String defname in x.actors[i].defNames) { foreach(String defname in x.actors[i].defNames) {
animInfo += defname + ", "; animInfo += defname + ", ";
} }
Log.Message(animInfo); if (AnimationSettings.debugMode)
Log.Message(animInfo);
} }
return false; return false;
@ -80,7 +79,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("Vagina")) { if (x.actors[i].requiredGenitals.Contains("Vagina")) {
if (!rjw.Genital_Helper.has_vagina(localParticipants[i])) { 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; return false;
} }
@ -89,7 +89,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("Penis")) { 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]))) { 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; return false;
} }
@ -98,7 +99,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("Mouth")) { if (x.actors[i].requiredGenitals.Contains("Mouth")) {
if (!rjw.Genital_Helper.has_mouth(localParticipants[i])) { 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; return false;
} }
@ -107,7 +109,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("Anus")) { if (x.actors[i].requiredGenitals.Contains("Anus")) {
if (!rjw.Genital_Helper.has_anus(localParticipants[i])) { 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; return false;
} }
@ -115,7 +118,8 @@ namespace Rimworld_Animations {
if(x.actors[i].requiredGenitals.Contains("Breasts")) { if(x.actors[i].requiredGenitals.Contains("Breasts")) {
if (!rjw.Genital_Helper.can_do_breastjob(localParticipants[i])) { 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; return false;
} }
} }
@ -123,7 +127,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoVagina")) { if (x.actors[i].requiredGenitals.Contains("NoVagina")) {
if (rjw.Genital_Helper.has_vagina(localParticipants[i])) { 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; return false;
} }
@ -132,7 +137,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoPenis")) { 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]))) { 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; return false;
} }
@ -141,7 +147,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoMouth")) { if (x.actors[i].requiredGenitals.Contains("NoMouth")) {
if (rjw.Genital_Helper.has_mouth(localParticipants[i])) { 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; return false;
} }
@ -150,7 +157,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoAnus")) { if (x.actors[i].requiredGenitals.Contains("NoAnus")) {
if (rjw.Genital_Helper.has_anus(localParticipants[i])) { 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; return false;
} }
@ -158,7 +166,8 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoBreasts")) { if (x.actors[i].requiredGenitals.Contains("NoBreasts")) {
if (rjw.Genital_Helper.can_do_breastjob(localParticipants[i])) { 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; return false;
} }
} }
@ -174,12 +183,14 @@ namespace Rimworld_Animations {
if (x.actors[i].isFucking && !rjw.xxx.can_fuck(localParticipants[i])) { 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; return false;
} }
if (x.actors[i].isFucked && !rjw.xxx.can_be_fucked(localParticipants[i])) { 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; return false;
} }
} }
@ -229,21 +240,25 @@ namespace Rimworld_Animations {
if (optionsWithSexTypeAndInitiator.Any()) { 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(); return optionsWithSexType.RandomElement();
} }
if (optionsWithSexType.Any()) { 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(); return optionsWithSexType.RandomElement();
} }
if(optionsWithInitiator.Any()) { if(optionsWithInitiator.Any()) {
Log.Message("Selecting animation for initiators..."); if (AnimationSettings.debugMode)
Log.Message("Selecting animation for initiators...");
} }
if (options != null && options.Any()) { if (options != null && options.Any()) {
Log.Message("Randomly selecting animation..."); if (AnimationSettings.debugMode)
Log.Message("Randomly selecting animation...");
return options.RandomElement(); return options.RandomElement();
} }
else else

View file

@ -98,12 +98,14 @@ namespace Rimworld_Animations {
public override void PreOpen() { public override void PreOpen() {
base.PreOpen(); base.PreOpen();
if(AnimationSettings.offsets == null) { if(AnimationSettings.offsets == null) {
Log.Message("New offsets"); if (AnimationSettings.debugMode)
Log.Message("New offsets");
AnimationSettings.offsets = new Dictionary<string, Vector2>(); AnimationSettings.offsets = new Dictionary<string, Vector2>();
} }
if(AnimationSettings.rotation == null) { if(AnimationSettings.rotation == null) {
Log.Message("New rotation"); if (AnimationSettings.debugMode)
Log.Message("New rotation");
AnimationSettings.rotation = new Dictionary<string, float>(); AnimationSettings.rotation = new Dictionary<string, float>();
} }
} }

View file

@ -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) { 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)) { 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; return;
} }
@ -80,7 +80,7 @@ namespace Rimworld_Animations {
bool mirror = GenTicks.TicksGame % 2 == 0; 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; IntVec3 pos = pawn.Position;
@ -106,7 +106,7 @@ namespace Rimworld_Animations {
} }
} }
else { else {
Log.Message("Anim not found"); Log.Message("No animation found");
//if pawn isn't already animating, //if pawn isn't already animating,
if (!pawn.TryGetComp<CompBodyAnimator>().isAnimating) { if (!pawn.TryGetComp<CompBodyAnimator>().isAnimating) {
(pawn.jobs.curDriver as JobDriver_SexBaseReciever).increase_time(duration); (pawn.jobs.curDriver as JobDriver_SexBaseReciever).increase_time(duration);

View file

@ -15,7 +15,8 @@ namespace Rimworld_Animations {
class HarmonyPatch_PlayAnimJoinInBedRMB { class HarmonyPatch_PlayAnimJoinInBedRMB {
public static void Prefix(ref Job job) { public static void Prefix(ref Job job) {
if(job.def == xxx.casual_sex) { 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<JobDef>.GetNamed("JoinInBedAnimation", true), job.targetA, job.targetB, job.targetC); job = new Job(DefDatabase<JobDef>.GetNamed("JoinInBedAnimation", true), job.targetA, job.targetB, job.targetC);
} }

View file

@ -12,7 +12,7 @@ namespace Rimworld_Animations {
public class AnimationSettings : ModSettings { public class AnimationSettings : ModSettings {
public static bool orgasmQuiver, rapeShiver, soundOverride = true, hearts = true, controlGenitalRotation = false, applySemenOnAnimationOrgasm = false, fastAnimForQuickie = false; 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 float shiverIntensity = 2f;
public static Dictionary<string, Vector2> offsets = new Dictionary<string, Vector2>(); public static Dictionary<string, Vector2> offsets = new Dictionary<string, Vector2>();
@ -22,6 +22,7 @@ namespace Rimworld_Animations {
base.ExposeData(); base.ExposeData();
Scribe_Values.Look(ref debugMode, "AnimsDebugMode", false);
Scribe_Values.Look(ref offsetTab, "EnableOffsetTab", false); Scribe_Values.Look(ref offsetTab, "EnableOffsetTab", false);
Scribe_Values.Look(ref controlGenitalRotation, "controlGenitalRotation", false); Scribe_Values.Look(ref controlGenitalRotation, "controlGenitalRotation", false);
Scribe_Values.Look(ref orgasmQuiver, "orgasmQuiver"); Scribe_Values.Look(ref orgasmQuiver, "orgasmQuiver");
@ -75,6 +76,8 @@ namespace Rimworld_Animations {
listingStandard.Label("Shiver/Quiver Intensity (default 2): " + AnimationSettings.shiverIntensity); listingStandard.Label("Shiver/Quiver Intensity (default 2): " + AnimationSettings.shiverIntensity);
AnimationSettings.shiverIntensity = listingStandard.Slider(AnimationSettings.shiverIntensity, 0.0f, 12f); AnimationSettings.shiverIntensity = listingStandard.Slider(AnimationSettings.shiverIntensity, 0.0f, 12f);
listingStandard.CheckboxLabeled("Debug Mode", ref AnimationSettings.debugMode);
listingStandard.End(); listingStandard.End();
base.DoSettingsWindowContents(inRect); base.DoSettingsWindowContents(inRect);