Move growth/shrink debug info into the widget to not clutter the logs

This commit is contained in:
lutepickle 2022-03-14 16:08:48 -07:00
parent b985f4188d
commit a5c9ada196
2 changed files with 10 additions and 6 deletions

Binary file not shown.

View File

@ -54,6 +54,7 @@ namespace RJW_Menstruation
protected float nippleSize = -1f;
protected long ageOfLastBirth = 0;
protected float breastSizeIncreased = 0f;
protected string debugGrowthStatus = "";
protected float originalpha = -1f;
protected float originareola = -1f;
protected float originnipple = -1f;
@ -67,7 +68,7 @@ namespace RJW_Menstruation
get
{
float res = parent.pawn.RaceProps.lifeStageAges.ElementAtOrDefault(1).minAge / 2;
if (res == 0.0f)
if (res == default)
{
if (Configurations.Debug) Log.Warning($"Could not find end age of baby lifestage for {parent.pawn}'s race");
res = 1.2f / 2; // Default to human
@ -269,7 +270,7 @@ namespace RJW_Menstruation
// Scenario A: the youngest child is less than halfway into babyhood: Full size
if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > parent.pawn.ageTracker.AgeBiologicalTicks)
{
if (Configurations.Debug) Log.Message($"Latest child of {parent.pawn} is young: breasts to full size");
debugGrowthStatus = "Full size due to young child";
if (breastSizeIncreased < MAX_BREAST_INCREMENT)
{
parent.Severity += (MAX_BREAST_INCREMENT - breastSizeIncreased);
@ -282,7 +283,7 @@ namespace RJW_Menstruation
float pregnancySize = Mathf.InverseLerp(1f / 6f, 1f / 3f, parent.pawn.GetPregnancyProgress()) * MAX_BREAST_INCREMENT;
if (breastSizeIncreased > pregnancySize)
{
if (Configurations.Debug) Log.Message($"{parent.pawn}'s breasts are too large for pregnancy ({breastSizeIncreased} > {pregnancySize}), shrinking");
debugGrowthStatus = "Shrinking due to being oversize for pregnancy";
// Breasts still large from the last kid
ShrinkBreasts();
}
@ -290,7 +291,7 @@ namespace RJW_Menstruation
{
// Time to grow
float growAmount = pregnancySize - breastSizeIncreased;
if (Configurations.Debug) Log.Message($"{parent.pawn} is pregnant, so growing breasts by {growAmount}");
debugGrowthStatus = "Growing due to pregnancy";
breastSizeIncreased += growAmount;
parent.Severity += growAmount;
}
@ -298,9 +299,10 @@ namespace RJW_Menstruation
// Scenario C: Not (or very early) pregnant and youngest child nonexistent or more than halfway into babyhood, time to shrink
else if (breastSizeIncreased > 0)
{
if (Configurations.Debug) Log.Message($"{parent.pawn}'s breasts are too large and she is not pregnant, shrinking");
debugGrowthStatus = "Shrinking due to no pregnancy nor young child";
ShrinkBreasts();
}
else debugGrowthStatus = "Base size";
}
public void ChangeColorFermanant(float alpha)
@ -384,7 +386,9 @@ namespace RJW_Menstruation
public string DebugInfo()
{
return "Alpha: " + alpha +
return "Increase: " + breastSizeIncreased +
"\n" + debugGrowthStatus +
"\nAlpha: " + alpha +
"\nNippleSize: " + nippleSize +
"\nAreolaSize: " + areolaSize +
"\nAlphaCurrent: " + alphaCurrent +