diff --git a/1.3/Assemblies/RJW_Menstruation.dll b/1.3/Assemblies/RJW_Menstruation.dll index 05beb25..d8e5ea7 100644 Binary files a/1.3/Assemblies/RJW_Menstruation.dll and b/1.3/Assemblies/RJW_Menstruation.dll differ diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs index fe24e06..35fcbcf 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Cum.cs @@ -1,6 +1,7 @@ using RimWorld; using System; using System.Collections.Generic; +using System.Text; using UnityEngine; using Verse; @@ -264,13 +265,14 @@ namespace RJW_Menstruation public string GetIngredients() { - string res = ""; + StringBuilder res = new StringBuilder(); + if (!cums.NullOrEmpty()) for (int i = 0; i < cums.Count; i++) { - res += cums[i]; - if (i < cums.Count - 1) res += ", "; + res.Append(cums[i]); + if (i < cums.Count - 1) res.Append(", "); } - return res; + return res.ToString(); } } } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 32307dc..956b904 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -4,6 +4,7 @@ using rjw; using System; using System.Collections.Generic; using System.Linq; +using System.Text; using UnityEngine; using Verse; @@ -423,19 +424,19 @@ namespace RJW_Menstruation { if (eggs.NullOrEmpty()) return ""; - string res = ""; + StringBuilder res = new StringBuilder(); int fertilized = eggs.Count(egg => egg.fertilized); - if (fertilized != 0) res += fertilized + " " + Translations.Dialog_WombInfo05; - if (fertilized != 0 && eggs.Count - fertilized != 0) res += ", "; + if (fertilized != 0) res.AppendFormat("{0} {1}", fertilized, Translations.Dialog_WombInfo05); + if (fertilized != 0 && eggs.Count - fertilized != 0) res.Append(", "); if (cums.NullOrEmpty() || TotalFertCum == 0) { - if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo07; + if (eggs.Count - fertilized != 0) res.AppendFormat("{0} {1}", eggs.Count - fertilized, Translations.Dialog_WombInfo07); } else { - if (eggs.Count - fertilized != 0) res += eggs.Count - fertilized + " " + Translations.Dialog_WombInfo06; + if (eggs.Count - fertilized != 0) res.AppendFormat("{0} {1}", eggs.Count - fertilized, Translations.Dialog_WombInfo06); } - return res; + return res.ToString(); } } public bool IsEggFertilizing diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index 98aa0e4..c05487e 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -2,6 +2,7 @@ using rjw; using System.Collections.Generic; using System.Linq; +using System.Text; using UnityEngine; using Verse; @@ -78,19 +79,19 @@ namespace RJW_Menstruation if (babies.NullOrEmpty()) return "Null"; - string res = ""; - + StringBuilder res = new StringBuilder(); + IEnumerable babiesdistinct = babies.Distinct(new RaceComparer()); int iteration = 0; foreach (Pawn baby in babiesdistinct) { int num = babies.Where(x => x.def.Equals(baby.def)).Count(); - if (iteration > 0) res += ", "; - res += num + " " + baby.def.label; + if (iteration > 0) res.Append(", "); + res.AppendFormat("{0} {1}", num, baby.def.label); iteration++; } - res += " " + Translations.Dialog_WombInfo02; - return res; + res.AppendFormat(" {0}", Translations.Dialog_WombInfo02); + return res.ToString(); } public string GetFatherInfo() @@ -98,20 +99,21 @@ namespace RJW_Menstruation if (babies.NullOrEmpty()) return "Null"; - string res = Translations.Dialog_WombInfo03 + ": "; - + StringBuilder res = new StringBuilder(); + res.AppendFormat("{0}: ", Translations.Dialog_WombInfo03); + if (!is_parent_known && Configurations.InfoDetail != Configurations.DetailLevel.All) - return res + Translations.Dialog_FatherUnknown; + return res.Append(Translations.Dialog_FatherUnknown).ToString(); IEnumerable babiesdistinct = babies.Distinct(new FatherComparer(pawn)); int iteration = 0; foreach (Pawn baby in babiesdistinct) { - if (iteration > 0) res += ", "; - res += Utility.GetFather(baby, pawn)?.LabelShort ?? Translations.Dialog_FatherUnknown; + if (iteration > 0) res.Append(", "); + res.Append(Utility.GetFather(baby, pawn)?.LabelShort ?? Translations.Dialog_FatherUnknown); iteration++; } - return res; + return res.ToString(); } private void HumanlikeBirth(Pawn baby) diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs index e214e89..7c8ab75 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs @@ -2,6 +2,7 @@ using rjw; using System.Collections.Generic; using System.Linq; +using System.Text; using UnityEngine; using Verse; @@ -42,15 +43,20 @@ namespace RJW_Menstruation private static Gizmo CreateGizmo_WombStatus(Pawn pawn, HediffComp_Menstruation comp) { Texture2D icon, icon_overay; - string description = ""; - if (Configurations.Debug) { - description += comp.curStage + ": " + comp.curStageHrs + "\n" + - (comp.Pregnancy is Hediff_MultiplePregnancy preg ? "due: " + preg.DueDate() + "\n" : "") + - "fertcums: " + comp.TotalFertCum + "\n" + - "ovarypower: " + comp.ovarypower + "\n" + - "eggs: " + comp.GetNumOfEggs + "\n"; + StringBuilder description = new StringBuilder(); + if (Configurations.Debug) + { + description + .AppendFormat("{0}: {1}\n", comp.curStage, comp.curStageHrs); + if (comp.Pregnancy is Hediff_MultiplePregnancy preg) description + .AppendFormat("due: {0}\n", preg.DueDate()); + description + .AppendFormat("fertcums: {0}\n" + + "ovarypower: {1}\n" + + "eggs: {2}\n", + comp.TotalFertCum, comp.ovarypower, comp.GetNumOfEggs); } - else description += comp.GetCurStageLabel + "\n"; + else description.AppendFormat("{0}\n", comp.GetCurStageLabel); if (pawn.IsRJWPregnant()) { Hediff_BasePregnancy hediff = comp.Pregnancy; @@ -84,14 +90,14 @@ namespace RJW_Menstruation icon_overay = comp.GetCumIcon(); } - foreach (string s in comp.GetCumsInfo) description += s + "\n"; + foreach (string s in comp.GetCumsInfo) description.AppendFormat("{0}\n", s); Color c = comp.GetCumMixtureColor; return new Gizmo_Womb { defaultLabel = pawn.LabelShort, - defaultDesc = description, + defaultDesc = description.ToString(), icon = icon, icon_overay = icon_overay, shrinkable = Configurations.AllowShrinkIcon, diff --git a/1.3/source/RJW_Menstruation/SexperienceModule/GatheredCumMixture.cs b/1.3/source/RJW_Menstruation/SexperienceModule/GatheredCumMixture.cs index b40ef61..f07b5b6 100644 --- a/1.3/source/RJW_Menstruation/SexperienceModule/GatheredCumMixture.cs +++ b/1.3/source/RJW_Menstruation/SexperienceModule/GatheredCumMixture.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Text; using UnityEngine; using Verse; @@ -38,13 +39,13 @@ namespace RJW_Menstruation.Sexperience public override string GetInspectString() { - string res = ""; + StringBuilder res = new StringBuilder(); if (!ingredients.NullOrEmpty()) for (int i = 0; i < ingredients.Count; i++) { - res += ingredients[i]; - if (i != ingredients.Count - 1) res += ", "; + res.Append(ingredients[i]); + if (i != ingredients.Count - 1) res.Append(", "); } - return res; + return res.ToString(); } public void InitwithCum(CumMixture cum) diff --git a/changelogs.txt b/changelogs.txt index b563992..8d6e4c5 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,7 +1,7 @@ Version 1.0.7.5 - Fix error when one womb's concealed estrus is overwritten by another womb's visible estrus. - Properly calculate cramp pain falloff again. - - Climacteric and menopause are now per-womb. Their effect on overall sex drive and satisfaction will depend on the health of any other wombs. + - Climacteric and menopause are now per-womb, appearing in the womb dialog instead of as hediffs. Any old hediffs should disappear upon loading the save. - Added new property to vaginas to multiply the number of eggs available. Archotech vaginas will have quadruple the normal amount. Version 1.0.7.4