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

@ -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,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<JobDef>.GetNamed("JoinInBedAnimation", true), job.targetA, job.targetB, job.targetC);
}