diff --git a/.gitignore b/.gitignore
index b14b0f8..2236aa5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -343,6 +343,3 @@ healthchecksdb
*.psd
*.dds
*.pdn
-
-Directory.Build.props
-Directory.Build.targets
diff --git a/1.6/Animal Genetics/Assemblies/Animal Genetics.dll b/1.6/Animal Genetics/Assemblies/Animal Genetics.dll
index e28598f..ff81c70 100644
Binary files a/1.6/Animal Genetics/Assemblies/Animal Genetics.dll and b/1.6/Animal Genetics/Assemblies/Animal Genetics.dll differ
diff --git a/1.6/Assemblies/RJW_Menstruation.dll b/1.6/Assemblies/RJW_Menstruation.dll
index 86b2376..458e7c3 100644
Binary files a/1.6/Assemblies/RJW_Menstruation.dll and b/1.6/Assemblies/RJW_Menstruation.dll differ
diff --git a/1.6/Defs/RJWTab/PawnColumnDefs_Menstruation.xml b/1.6/Defs/RJWTab/PawnColumnDefs_Menstruation.xml
deleted file mode 100644
index 1ef4a86..0000000
--- a/1.6/Defs/RJWTab/PawnColumnDefs_Menstruation.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- RJWMenstruation_Womb
- Womb/Womb
- Open womb status. Click the header to sort by womb presence and cycle stage.
- RJW_Menstruation.MainTab.PawnColumnWorker_WombStatus
- true
- 34
-
-
diff --git a/1.6/Humanoid Alien Races/Assemblies/HAR.dll b/1.6/Humanoid Alien Races/Assemblies/HAR.dll
index 611da42..4ce2a5f 100644
Binary files a/1.6/Humanoid Alien Races/Assemblies/HAR.dll and b/1.6/Humanoid Alien Races/Assemblies/HAR.dll differ
diff --git a/1.6/Languages/ChineseTraditional/Keyed/RJW_Menstruation.xml b/1.6/Languages/ChineseTraditional/Keyed/RJW_Menstruation.xml
index d61c6b9..99bf5f0 100644
--- a/1.6/Languages/ChineseTraditional/Keyed/RJW_Menstruation.xml
+++ b/1.6/Languages/ChineseTraditional/Keyed/RJW_Menstruation.xml
@@ -166,7 +166,4 @@
已吸收
子宮處於月經週期之外。經過足夠的時間後,月經週期會恢復。
-
- 對已經不育的子宮顯示子宮圖示
- 仍然展示不育的子宮狀態
diff --git a/1.6/Patches/RJW_PawnTableDefs.xml b/1.6/Patches/RJW_PawnTableDefs.xml
deleted file mode 100644
index edbc555..0000000
--- a/1.6/Patches/RJW_PawnTableDefs.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
- /Defs/PawnTableDef[defName="RJW_PawnTable_Colonists"]/columns/li[text()="Pregnant"]
-
- RJWMenstruation_Womb
-
-
-
- /Defs/PawnTableDef[defName="RJW_PawnTable_Property"]/columns/li[text()="Pregnant"]
-
- RJWMenstruation_Womb
-
-
-
-
-
diff --git a/1.6/Quirks/Assemblies/Quirks.dll b/1.6/Quirks/Assemblies/Quirks.dll
index 91a4a19..774829d 100644
Binary files a/1.6/Quirks/Assemblies/Quirks.dll and b/1.6/Quirks/Assemblies/Quirks.dll differ
diff --git a/1.6/Quirks/Source/Quirks/RedWings.cs b/1.6/Quirks/Source/Quirks/RedWings.cs
index 0623748..2c11420 100644
--- a/1.6/Quirks/Source/Quirks/RedWings.cs
+++ b/1.6/Quirks/Source/Quirks/RedWings.cs
@@ -13,7 +13,8 @@ namespace RJW_Menstruation_Quirks
{
public override bool Satisfied(Pawn pawn)
{
- return pawn.GetGenitalsList().Any(genital => (genital.def as HediffDef_SexPart)?.genitalFamily == GenitalFamily.Penis);
+ List genitalsList = pawn.GetGenitalsList();
+ return genitalsList.Any(genital => (genital.def as HediffDef_SexPart)?.genitalFamily == GenitalFamily.Penis);
}
}
diff --git a/1.6/Vanilla Expanded Core/Assemblies/VECore.dll b/1.6/Vanilla Expanded Core/Assemblies/VECore.dll
index f47a501..d99975c 100644
Binary files a/1.6/Vanilla Expanded Core/Assemblies/VECore.dll and b/1.6/Vanilla Expanded Core/Assemblies/VECore.dll differ
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/Cum.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/Cum.cs
index 94eecdb..b02d683 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/Cum.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/Cum.cs
@@ -169,13 +169,6 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref useCustomColor, "useCustomColor", false);
Scribe_Values.Look(ref customColor, "customColor", default);
Scribe_Defs.Look(ref filthDef, "filthDef");
- if (Scribe.mode == LoadSaveMode.PostLoadInit &&
- (Single.IsInfinity(FertVolume) || Single.IsNaN(FertVolume) || volume < 0f))
- {
- Log.Error($"Invalid amount of {pawn}'s cum in a womb");
- volume = 0;
- fertility = 0;
- }
}
public void MakeThinner(float speed)
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
index afca25e..f8e807b 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs
@@ -126,7 +126,7 @@ namespace RJW_Menstruation
protected int? opcache = null;
protected float antisperm = 0.0f;
// RJW pregnancy, or Biotech pregnancy/labor/laborpushing
- protected Hediff pregnancy = null; // Remove, instead reference per-genital pregnancy list
+ protected Hediff pregnancy = null;
protected int eggLifeSpanTicks = GenDate.DaysToTicks(2);
protected EstrusLevel estrusLevel = EstrusLevel.Visible;
@@ -313,7 +313,7 @@ namespace RJW_Menstruation
{
StatDefOf.Fertility.Worker.ClearCacheForThing(Pawn); // No effect for now, but a future RW update might add caching for this
calculatingOvulationChance = true;
- ovulationChance *= PawnCapacityUtility.CalculateCapacityLevel(Pawn.health.hediffSet, xxx.reproduction); // Add genital fertility
+ ovulationChance *= PawnCapacityUtility.CalculateCapacityLevel(Pawn.health.hediffSet, xxx.reproduction);
}
finally
{
@@ -672,16 +672,7 @@ namespace RJW_Menstruation
}
}
- private void ProcessExtension(MenstruationModExtension extension)
- {
- eggLifeSpanTicks = (int)(eggLifeSpanTicks * extension.eggLifeTimeFactor);
- if (extension.alwaysEstrus) estrusLevel = EstrusLevel.Visible;
- else if (extension.neverEstrus) estrusLevel = EstrusLevel.None;
- ovulationFactor *= extension.ovulationFactor;
- if (extension.noBleeding) noBleeding = true;
- }
-
- public void DirtyStats()
+ public void Notify_UpdatedGenes()
{
eggLifeSpanTicks = GenDate.DaysToTicks(Props.eggLifespanDays);
estrusLevel = Props.concealedEstrus ? EstrusLevel.Concealed : EstrusLevel.Visible;
@@ -689,31 +680,19 @@ namespace RJW_Menstruation
noBleeding = false;
opcache = null;
- MenstruationModExtension thingExtension = Pawn.def.GetModExtension();
- if (thingExtension != null)
- ProcessExtension(thingExtension);
-
- if (Pawn.genes != null && ModsConfig.BiotechActive)
- foreach (MenstruationModExtension geneExtension in Pawn.genes.GenesListForReading.Where(gene => gene.Active).Select(gene => gene.def.GetModExtension()).Where(ext => ext != null))
- ProcessExtension(geneExtension);
-
- foreach (MenstruationModExtension hediffExtension in Pawn.health.hediffSet.hediffs.Select(hediff => hediff.def.GetModExtension()).Where(ext => ext != null))
- ProcessExtension(hediffExtension);
-
+ if (Pawn.genes == null || !ModsConfig.BiotechActive) return;
+ foreach (MenstruationModExtension extension in Pawn.genes.GenesListForReading.Where(gene => gene.Active).Select(gene => gene.def.GetModExtension()).Where(ext => ext != null))
+ {
+ eggLifeSpanTicks = (int)(eggLifeSpanTicks * extension.eggLifeTimeFactor);
+ if (extension.alwaysEstrus) estrusLevel = EstrusLevel.Visible;
+ else if (extension.neverEstrus) estrusLevel = EstrusLevel.None;
+ ovulationFactor *= extension.ovulationFactor;
+ if (extension.noBleeding) noBleeding = true;
+ }
if (eggLifeSpanTicks < 0) eggLifeSpanTicks = 0;
if (ovulationFactor < 0f) ovulationFactor = 0f;
}
- public void Notify_UpdatedGenes()
- {
- DirtyStats();
- }
-
- public void Notify_HediffsChanged()
- {
- DirtyStats();
- }
-
public bool ShouldSimulate()
{
if (!Pawn.ShouldCycle()) return false;
@@ -882,11 +861,6 @@ namespace RJW_Menstruation
return cums?.Find(cum => !cum.notcum && cum.pawn == pawn);
}
- public IEnumerable GetFluids()
- {
- return cums ?? Enumerable.Empty();
- }
-
public IEnumerable GetFluids(Pawn pawn)
{
return cums?.Where(cum => cum.pawn == pawn) ?? Enumerable.Empty();
@@ -1255,7 +1229,7 @@ namespace RJW_Menstruation
protected virtual void PreInitialize()
{
- DirtyStats();
+ Notify_UpdatedGenes();
}
protected virtual void PostInitialize()
@@ -1481,7 +1455,7 @@ namespace RJW_Menstruation
try
{
if (Configurations.Debug) Log.Message($"Implanting fertilized egg of {Pawn} into {parent}, father {egg.fertilizer}");
- if (pregnancy == null) // Support pregnancy list, maybe split off into function
+ if (pregnancy == null)
{
Configurations.PregnancyType usePregnancy = xxx.is_human(Pawn) ? Configurations.PregnancySource : Configurations.PregnancyType.MultiplePregnancy;
switch (usePregnancy)
@@ -1499,7 +1473,7 @@ namespace RJW_Menstruation
case Configurations.PregnancyType.MultiplePregnancy:
if (Configurations.Debug) Log.Message($"Creating new menstruation pregnancy");
- pregnancy = Hediff_BasePregnancy.Create(Pawn, egg.fertilizer); // Add fertility comp of mother
+ pregnancy = Hediff_BasePregnancy.Create(Pawn, egg.fertilizer);
pregnant = true;
deadeggs.Add(egg);
break;
@@ -1856,7 +1830,6 @@ namespace RJW_Menstruation
protected virtual void ThoughtCumInside(Pawn cummer)
{
- const int haterThreshold = -5;
MemoryThoughtHandler cummerMemories = cummer?.needs?.mood?.thoughts.memories;
MemoryThoughtHandler pawnMemories = Pawn?.needs?.mood?.thoughts.memories;
@@ -1864,7 +1837,7 @@ namespace RJW_Menstruation
if (cummer.IsProPregnancy(out Precept preceptm) || (cummer.IsTeratophile() != (Pawn.GetStatValue(StatDefOf.PawnBeauty) >= 0)))
{
- if (cummer.relations.OpinionOf(Pawn) <= haterThreshold)
+ if (cummer.relations.OpinionOf(Pawn) <= -5)
cummerMemories.TryGainMemory(VariousDefOf.HaterCameInsideM, Pawn);
else if (preceptm != null)
cummerMemories.TryGainMemory(VariousDefOf.CameInsideMIdeo, Pawn, preceptm);
@@ -1878,14 +1851,14 @@ namespace RJW_Menstruation
{
if (preceptf != null)
{
- if (Pawn.relations.OpinionOf(cummer) <= haterThreshold)
+ if (Pawn.relations.OpinionOf(cummer) <= -5)
pawnMemories.TryGainMemory(VariousDefOf.HaterCameInsideFIdeo, cummer, preceptf);
else
pawnMemories.TryGainMemory(VariousDefOf.CameInsideFIdeo, cummer, preceptf);
}
else pawnMemories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer);
}
- else if (Pawn.relations.OpinionOf(cummer) <= haterThreshold)
+ else if (Pawn.relations.OpinionOf(cummer) <= -5)
pawnMemories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
else if (Pawn.IsInEstrus() && Pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
pawnMemories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer);
@@ -1899,7 +1872,7 @@ namespace RJW_Menstruation
{
if (Pawn.IsProPregnancy(out Precept _))
pawnMemories.TryGainMemory(VariousDefOf.CameInsideFFetishSafe, cummer);
- else if (Pawn.relations.OpinionOf(cummer) <= haterThreshold)
+ else if (Pawn.relations.OpinionOf(cummer) <= -5)
pawnMemories.TryGainMemory(VariousDefOf.HaterCameInsideFSafe, cummer);
}
}
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs
index 92f5dfc..b25f098 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs
@@ -87,27 +87,35 @@ namespace RJW_Menstruation
return 1.0f - Mathf.Pow(1.0f - Configurations.FertilizeChance, comp.TotalFertCum * comp.Props.basefertilizationChanceFactor);
}
- public static string GetSingleBabyImage(HediffComp_Menstruation comp, Hediff pregnancy)
- {
- ThingDef babydef;
- HediffComp_PregeneratedBabies babiescomp = pregnancy?.TryGetComp();
- if (pregnancy.IsMechanoidPregnant()) babydef = (pregnancy as Hediff_BasePregnancy)?.babies?.FirstOrDefault()?.def ?? VariousDefOf.Scyther;
- else if (pregnancy is Hediff_BasePregnancy preg) babydef = preg.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human;
- else if (babiescomp?.HasBaby ?? false) babydef = babiescomp.PeekBaby().def;
- else babydef = comp.Pawn.def;
-
- return babydef.GetModExtension()?.fetusTexPath ?? "Fetus/Fetus_Default";
- }
-
public static Texture2D GetPregnancyIcon(this HediffComp_Menstruation comp, Hediff hediff)
{
float gestationProgress = comp.StageProgress;
+ ThingDef babydef;
int babycount;
- if (hediff is Hediff_BasePregnancy preg) babycount = preg.babies?.Count ?? 1;
- else babycount = hediff?.TryGetComp()?.BabyCount ?? 1;
+ HediffComp_PregeneratedBabies babiescomp = hediff?.TryGetComp();
+ if (hediff.IsMechanoidPregnant())
+ {
+ babydef = (hediff as Hediff_BasePregnancy)?.babies?.FirstOrDefault()?.def ?? VariousDefOf.Scyther;
+ babycount = 1;
+ }
+ else if (hediff is Hediff_BasePregnancy preg)
+ {
+ babydef = preg.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human;
+ babycount = preg.babies?.Count ?? 1;
+ }
+ else if (babiescomp?.HasBaby ?? false)
+ {
+ babydef = babiescomp.PeekBaby().def;
+ babycount = babiescomp.BabyCount;
+ }
+ else
+ {
+ babydef = comp.Pawn.def;
+ babycount = 1;
+ }
- string fetustex = GetSingleBabyImage(comp, hediff);
+ string fetustex = babydef.GetModExtension()?.fetusTexPath ?? "Fetus/Fetus_Default";
string icon;
if (gestationProgress < 0.2f) icon = comp.WombTex + "_Implanted";
else if (gestationProgress < 0.4f) icon = fetustex + "00";
@@ -308,11 +316,11 @@ namespace RJW_Menstruation
return ContentFinder.Get(icon, true);
}
- // comp used by Menstruation Fluids
- public static Texture2D GetAnalIcon(this Pawn pawn, HediffComp_Menstruation comp)
+ public static Texture2D GetAnalIcon(this Pawn pawn)
{
- if (!pawn.GetAnusList().Any()) return ContentFinder.Get("Genitals/Anal00", true);
- Hediff hediff = pawn.GetAnusList().MaxBy(a => a.Severity);
+ Hediff hediff = pawn.health.hediffSet.hediffs.FirstOrDefault(h => VariousDefOf.AllAnuses.Contains(h.def)) ??
+ pawn.health.hediffSet.hediffs.FirstOrDefault(h => h.def.defName.ToLower().Contains("anus"));
+ if (hediff == null) return ContentFinder.Get("Genitals/Anal00", true);
string icon = ((CompProperties_Anus)hediff.GetAnusComp()?.props)?.analTex ?? "Genitals/Anal";
float severity = hediff.Severity;
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs
index e67afc0..52c356b 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs
@@ -10,12 +10,6 @@ namespace RJW_Menstruation
{
protected Dictionary enzygoticSiblings = new Dictionary(); // Each pawn and who they split from
- // used by Eltoro's addons
- public override void PostMake()
- {
- base.PostMake();
- }
-
public override void DiscoverPregnancy()
{
PregnancyThought();
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/MainTab/PawnColumnWorker_WombStatus.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/MainTab/PawnColumnWorker_WombStatus.cs
deleted file mode 100644
index 3c28db8..0000000
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/MainTab/PawnColumnWorker_WombStatus.cs
+++ /dev/null
@@ -1,138 +0,0 @@
-using RimWorld;
-using UnityEngine;
-using Verse;
-
-namespace RJW_Menstruation.MainTab
-{
- public class PawnColumnWorker_WombStatus : PawnColumnWorker
- {
- private const float CellIconSize = 24f;
- private const float ProgressBarHeight = 2f;
- private const float IconScale = 0.85f;
- private const int HasVisibleWombOffset = 100;
-
- public override void DoCell(Rect rect, Pawn pawn, PawnTable table)
- {
- HediffComp_Menstruation comp = GetDisplayComp(pawn);
- if (comp == null) return;
-
- Gizmo_Womb gizmo = Pawn_GetGizmos.CreateGizmo_WombStatus(pawn, comp);
- Rect iconRect = new Rect(
- rect.x + (rect.width - CellIconSize) / 2f,
- rect.y + Mathf.Max((rect.height - CellIconSize) / 2f, 0f),
- CellIconSize,
- CellIconSize);
-
- DrawCellIcon(iconRect, gizmo);
-
- if (Mouse.IsOver(iconRect) && !gizmo.defaultDesc.NullOrEmpty())
- {
- TooltipHandler.TipRegion(iconRect, gizmo.defaultDesc);
- }
-
- if (Widgets.ButtonInvisible(iconRect, doMouseoverSound: false))
- {
- Dialog_WombStatus.ToggleWindow(pawn, comp);
- }
- }
-
- public override int GetMinWidth(PawnTable table)
- {
- return 30;
- }
-
- public override int GetMaxWidth(PawnTable table)
- {
- return GetMinWidth(table);
- }
-
- public override int GetMinCellHeight(Pawn pawn)
- {
- return 30;
- }
-
- public override int Compare(Pawn a, Pawn b)
- {
- int result = GetSortValue(a).CompareTo(GetSortValue(b));
- if (result != 0) return result;
-
- return string.CompareOrdinal(a.LabelShortCap, b.LabelShortCap);
- }
-
- private static HediffComp_Menstruation GetDisplayComp(Pawn pawn)
- {
- if (!pawn.ShowStatus() || !pawn.ShouldCycle()) return null;
-
- HediffComp_Menstruation comp = pawn.GetFirstMenstruationComp();
- if (comp == null) return null;
-
- if (!Configurations.ShowInfertileIcon &&
- (comp.CurrentVisibleStage == HediffComp_Menstruation.Stage.Infertile ||
- comp.CurrentVisibleStage == HediffComp_Menstruation.Stage.None))
- {
- return null;
- }
-
- return comp;
- }
-
- private static int GetSortValue(Pawn pawn)
- {
- if (!pawn.ShowStatus() || !pawn.ShouldCycle()) return int.MinValue;
-
- HediffComp_Menstruation comp = pawn.GetFirstMenstruationComp();
- if (comp == null) return int.MinValue + 1;
-
- return HasVisibleWombOffset + GetStageSortValue(comp.CurrentVisibleStage);
- }
-
- private static int GetStageSortValue(HediffComp_Menstruation.Stage stage)
- {
- switch (stage)
- {
- case HediffComp_Menstruation.Stage.Luteal:
- return 9;
- case HediffComp_Menstruation.Stage.Ovulatory:
- return 8;
- case HediffComp_Menstruation.Stage.Follicular:
- return 7;
- case HediffComp_Menstruation.Stage.Pregnant:
- return 6;
- case HediffComp_Menstruation.Stage.Bleeding:
- return 5;
- case HediffComp_Menstruation.Stage.Recover:
- return 4;
- case HediffComp_Menstruation.Stage.Anestrus:
- return 3;
- case HediffComp_Menstruation.Stage.Infertile:
- return 2;
- case HediffComp_Menstruation.Stage.None:
- return 1;
- default:
- return 0;
- }
- }
-
- private static void DrawCellIcon(Rect rect, Gizmo_Womb gizmo)
- {
- Texture baseIcon = gizmo.icon ?? BaseContent.BadTex;
- Texture overlay = gizmo.icon_overlay ?? BaseContent.BadTex;
-
- Widgets.DrawTextureFitted(rect, baseIcon, IconScale);
-
- Color oldColor = GUI.color;
- GUI.color = gizmo.cumcolor;
- Widgets.DrawTextureFitted(rect, overlay, IconScale);
- GUI.color = Color.white;
-
- if (Configurations.DrawEggOverlay)
- {
- gizmo.comp.DrawEggOverlay(rect, false);
- }
-
- Rect progressRect = new Rect(rect.x + 2f, rect.y, rect.width - 4f, ProgressBarHeight);
- Widgets.FillableBar(progressRect, gizmo.comp.StageProgress, gizmo.comp.GetStageTexture);
- GUI.color = oldColor;
- }
- }
-}
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs
index 7ff4746..ee40f8c 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs
@@ -204,17 +204,6 @@ namespace RJW_Menstruation
}
}
- [HarmonyPatch(typeof(Pawn_HealthTracker), nameof(Pawn_HealthTracker.CheckForStateChange))]
- public class CheckForStateChange_Patch
- {
- public static void Postfix(Pawn ___pawn, Hediff hediff)
- {
- if (hediff == null || !hediff.def.HasModExtension()) return;
- foreach (HediffComp_Menstruation comp in ___pawn.GetMenstruationComps())
- comp.Notify_HediffsChanged();
- }
- }
-
[HarmonyPatch(typeof(Pawn_GeneTracker), "Notify_GenesChanged")]
public class Notify_GenesChanged_Patch
{
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/Gizmo_Patch.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/Gizmo_Patch.cs
index 8c2b59b..7838e01 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/Gizmo_Patch.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/Gizmo_Patch.cs
@@ -46,7 +46,7 @@ namespace RJW_Menstruation
}
- internal static Gizmo_Womb CreateGizmo_WombStatus(Pawn pawn, HediffComp_Menstruation comp)
+ private static Gizmo CreateGizmo_WombStatus(Pawn pawn, HediffComp_Menstruation comp)
{
if (!comp.loaded)
comp.Initialize();
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs
index fa25f4c..b1577ec 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs
@@ -23,7 +23,7 @@ namespace RJW_Menstruation
if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return true;
if (!mother.ShouldCycle()) return true;
- if (!InteractionCanCausePregnancy(props)) return true;
+ if (!InteractionCanCausePregnancy(props)) return false;
List pawnparts = Genital_Helper.get_PartsHediffList(father, Genital_Helper.get_genitalsBPR(father));
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/1.6/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj
index 26593c6..0c6dfeb 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj
@@ -90,7 +90,6 @@
-
@@ -179,4 +178,4 @@
-
+
\ No newline at end of file
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs
index e172853..72706ef 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs
@@ -390,7 +390,7 @@ namespace RJW_Menstruation
Rect genitalAnusLabelRect = new Rect(rect.x, rect.y + fontheight + genitalRectHeight, genitalRectWidth, fontheight);
vagina = pawn.GetGenitalIcon(comp);
- anal = pawn.GetAnalIcon(comp);
+ anal = pawn.GetAnalIcon();
GUI.color = new Color(1.00f, 0.47f, 0.47f, 1);
GUI.Box(rect, "", boxstyle);
GUI.color = Utility.SafeSkinColor(pawn);
diff --git a/1.6/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/1.6/source/RJW_Menstruation/RJW_Menstruation/Utility.cs
index 854e200..26deb88 100644
--- a/1.6/source/RJW_Menstruation/RJW_Menstruation/Utility.cs
+++ b/1.6/source/RJW_Menstruation/RJW_Menstruation/Utility.cs
@@ -188,9 +188,60 @@ namespace RJW_Menstruation
public static void DrawBreastIcon(this Pawn pawn, Rect rect)
{
+ Hediff hediff = pawn.health.hediffSet.hediffs.FirstOrDefault(h => VariousDefOf.AllBreasts.Contains(h.def));
Texture2D breast, nipple, areola;
- int breastCount = pawn.GetBreastList().Count();
- if (breastCount == 0)
+ if (hediff != null)
+ {
+ HediffComp_Breast comp = hediff.TryGetComp();
+ string icon;
+ if (comp != null) icon = comp.BreastTex ?? "Breasts/Breast_Breast";
+ else
+ {
+ breast = ContentFinder.Get("Breasts/Breast_Breast00", false);
+ nipple = ContentFinder.Get("Breasts/Breast_Breast00_Nipple00", false);
+ areola = ContentFinder.Get("Breasts/Breast_Breast00_Areola00", false);
+
+ GUI.color = SafeSkinColor(pawn);
+ GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit);
+ GUI.color = Color.white;
+ GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);
+ GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
+ return;
+ }
+
+ if (hediff.Severity < 0.20f) icon += "_Breast00";
+ else if (hediff.Severity < 0.40f) icon += "_Breast01";
+ else if (hediff.Severity < 0.60f) icon += "_Breast02";
+ else if (hediff.Severity < 0.80f) icon += "_Breast03";
+ else if (hediff.Severity < 1.00f) icon += "_Breast04";
+ else icon += "_Breast05";
+
+ string nippleicon, areolaicon;
+ float nipplesize, areolasize;
+ nipplesize = comp.NippleSize;
+ areolasize = comp.AreolaSize;
+
+ nippleicon = icon + "_Nipple0" + GetNippleIndex(nipplesize);
+ areolaicon = icon + "_Areola0" + GetAreolaIndex(areolasize);
+
+
+ breast = ContentFinder.Get(icon, false);
+ areola = ContentFinder.Get(areolaicon, false);
+ nipple = ContentFinder.Get(nippleicon, false);
+ GUI.color = SafeSkinColor(pawn);
+ GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit);
+
+ GUI.color = comp.NippleColor;
+
+ GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);
+
+ GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
+
+
+ if (Configurations.Debug) TooltipHandler.TipRegion(rect, comp.DebugInfo());
+
+ }
+ else
{
breast = ContentFinder.Get("Breasts/Breast_Breast00", false);
nipple = ContentFinder.Get("Breasts/Breast_Breast00_Nipple00", false);
@@ -200,42 +251,10 @@ namespace RJW_Menstruation
GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit);
GUI.color = Color.white;
GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);
- GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
- return;
+ GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
}
- Hediff hediff = pawn.GetBreastList().MaxBy(h => h.Severity);
- HediffComp_Breast comp = hediff.TryGetComp();
- string icon;
- if (breastCount > 1) icon = "Breasts_Udder/Breast";
- else icon = comp?.BreastTex ?? "Breasts/Breast";
- if (hediff.Severity < 0.20f) icon += "_Breast00";
- else if (hediff.Severity < 0.40f) icon += "_Breast01";
- else if (hediff.Severity < 0.60f) icon += "_Breast02";
- else if (hediff.Severity < 0.80f) icon += "_Breast03";
- else if (hediff.Severity < 1.00f) icon += "_Breast04";
- else icon += "_Breast05";
-
- string nippleicon, areolaicon;
- float nipplesize, areolasize;
- nipplesize = comp?.NippleSize ?? 0.4f;
- areolasize = comp?.AreolaSize ?? 0.4f;
-
- nippleicon = icon + "_Nipple0" + GetNippleIndex(nipplesize);
- areolaicon = icon + "_Areola0" + GetAreolaIndex(areolasize);
-
- breast = ContentFinder.Get(icon, false);
- areola = ContentFinder.Get(areolaicon, false);
- nipple = ContentFinder.Get(nippleicon, false);
-
- GUI.color = SafeSkinColor(pawn);
- GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit);
- GUI.color = comp?.NippleColor ?? Color.white;
- GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);
- GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
-
- if (Configurations.Debug && comp != null) TooltipHandler.TipRegion(rect, comp.DebugInfo());
}
public static int GetNippleIndex(float nipplesize)
@@ -339,7 +358,7 @@ namespace RJW_Menstruation
}
public static string GetBreastLabel(this Pawn pawn)
{
- Hediff hediff = pawn.health.hediffSet.hediffs.Where(h => VariousDefOf.AllBreasts.Contains(h.def)).MaxByWithFallback(h => h.Severity);
+ Hediff hediff = pawn.health.hediffSet.hediffs.FirstOrDefault(h => VariousDefOf.AllBreasts.Contains(h.def));
if (hediff != null) return hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")";
else return "";
}
diff --git a/About/Manifest.xml b/About/Manifest.xml
index bef173d..6b24453 100644
--- a/About/Manifest.xml
+++ b/About/Manifest.xml
@@ -1,7 +1,7 @@
RJW Menstruation
- 1.6.2.4
+ 1.6.2.0
diff --git a/changelogs.txt b/changelogs.txt
index 7316879..e776155 100644
--- a/changelogs.txt
+++ b/changelogs.txt
@@ -1,17 +1,3 @@
-Version 1.6.2.4
- - Fix error on startup and missing womb status in RJW tab with RJW 6.1.4.
-
-Version 1.6.2.3
- - Fix multiple breasts not appearing in the menstruation UI.
- - Status of wombs now appears in RJW main tab, contributed by GhostClinic.
-
-Version 1.6.2.2
- - Pawns with multiple breasts will now display an udder in the menstruation UI.
- - Updated Traditional Chinese translation by Hydrogen.
-
-Version 1.6.2.1
- - Modifiers in MenstruationModExtensions in ThingDefs and HediffDefs now function.
-
Version 1.6.2.0
- Added support for adding the MenstruationModExtension to ThingDefs and HediffDefs.
- This can be used to disable the menstrual cycle on pawns of particular types and with particular hediffs.