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,17 +44,15 @@ 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,6 +67,7 @@ namespace Rimworld_Animations {
foreach(String defname in x.actors[i].defNames) {
animInfo += defname + ", ";
}
if (AnimationSettings.debugMode)
Log.Message(animInfo);
}
@ -80,6 +79,7 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("Vagina")) {
if (!rjw.Genital_Helper.has_vagina(localParticipants[i])) {
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,6 +89,7 @@ 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]))) {
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,6 +99,7 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("Mouth")) {
if (!rjw.Genital_Helper.has_mouth(localParticipants[i])) {
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,6 +109,7 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("Anus")) {
if (!rjw.Genital_Helper.has_anus(localParticipants[i])) {
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,6 +118,7 @@ namespace Rimworld_Animations {
if(x.actors[i].requiredGenitals.Contains("Breasts")) {
if (!rjw.Genital_Helper.can_do_breastjob(localParticipants[i])) {
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,6 +127,7 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoVagina")) {
if (rjw.Genital_Helper.has_vagina(localParticipants[i])) {
if (AnimationSettings.debugMode)
Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has vagina");
return false;
}
@ -132,6 +137,7 @@ 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]))) {
if (AnimationSettings.debugMode)
Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has penis");
return false;
}
@ -141,6 +147,7 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoMouth")) {
if (rjw.Genital_Helper.has_mouth(localParticipants[i])) {
if (AnimationSettings.debugMode)
Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has mouth");
return false;
}
@ -150,6 +157,7 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoAnus")) {
if (rjw.Genital_Helper.has_anus(localParticipants[i])) {
if (AnimationSettings.debugMode)
Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has anus");
return false;
}
@ -158,6 +166,7 @@ namespace Rimworld_Animations {
if (x.actors[i].requiredGenitals.Contains("NoBreasts")) {
if (rjw.Genital_Helper.can_do_breastjob(localParticipants[i])) {
if (AnimationSettings.debugMode)
Log.Message(x.defName.ToStringSafe() + " not selected -- " + localParticipants[i].def.defName.ToStringSafe() + " " + localParticipants[i].Name.ToStringSafe() + " has breasts");
return false;
}
@ -174,11 +183,13 @@ namespace Rimworld_Animations {
if (x.actors[i].isFucking && !rjw.xxx.can_fuck(localParticipants[i])) {
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])) {
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,20 +240,24 @@ namespace Rimworld_Animations {
if (optionsWithSexTypeAndInitiator.Any()) {
if (AnimationSettings.debugMode)
Log.Message("Selecting animation for rjwSexType " + sexType.ToStringSafe() + " and initiators...");
return optionsWithSexType.RandomElement();
}
if (optionsWithSexType.Any()) {
if (AnimationSettings.debugMode)
Log.Message("Selecting animation for rjwSexType " + sexType.ToStringSafe() + "...");
return optionsWithSexType.RandomElement();
}
if(optionsWithInitiator.Any()) {
if (AnimationSettings.debugMode)
Log.Message("Selecting animation for initiators...");
}
if (options != null && options.Any()) {
if (AnimationSettings.debugMode)
Log.Message("Randomly selecting animation...");
return options.RandomElement();
}

View File

@ -98,11 +98,13 @@ namespace Rimworld_Animations {
public override void PreOpen() {
base.PreOpen();
if(AnimationSettings.offsets == null) {
if (AnimationSettings.debugMode)
Log.Message("New offsets");
AnimationSettings.offsets = new Dictionary<string, Vector2>();
}
if(AnimationSettings.rotation == null) {
if (AnimationSettings.debugMode)
Log.Message("New rotation");
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) {
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<CompBodyAnimator>().isAnimating) {
(pawn.jobs.curDriver as JobDriver_SexBaseReciever).increase_time(duration);

View File

@ -15,6 +15,7 @@ namespace Rimworld_Animations {
class HarmonyPatch_PlayAnimJoinInBedRMB {
public static void Prefix(ref Job job) {
if(job.def == xxx.casual_sex) {
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);
}

View File

@ -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<string, Vector2> offsets = new Dictionary<string, Vector2>();
@ -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);