diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index 3c05d62..cba755b 100644 Binary files a/1.4/Assemblies/RJW_Menstruation.dll and b/1.4/Assemblies/RJW_Menstruation.dll differ diff --git a/1.4/MilkModule/Assemblies/MilkModule.dll b/1.4/MilkModule/Assemblies/MilkModule.dll index 451e5c1..20460de 100644 Binary files a/1.4/MilkModule/Assemblies/MilkModule.dll and b/1.4/MilkModule/Assemblies/MilkModule.dll differ diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 027a1b3..4491d80 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -550,8 +550,7 @@ namespace RJW_Menstruation break; case Hediff_Labor _: case Hediff_LaborPushing _: - is_discovered = true; - break; + return 1.0f; } if (is_discovered || Configurations.infoDetail == Configurations.DetailLevel.All) return pregnancy.Severity; diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs index 31b61bc..a243f52 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -89,31 +89,34 @@ namespace RJW_Menstruation public static Texture2D GetPregnancyIcon(this HediffComp_Menstruation comp, Hediff hediff) { - string icon = ""; - int babycount = 1; if (hediff is Hediff_MechanoidPregnancy) - { return ContentFinder.Get(("Womb/Mechanoid_Fluid"), true); - } - else if (hediff is Hediff_BasePregnancy h) + + string icon = "Fetus/Slime_Abomi02"; + string fetustex = "Fetus/Fetus_Default"; + ThingDef babydef = comp.Pawn.def; // TODO: Pregenerated babies + + float gestationProgress = comp.StageProgress; + int babycount = hediff is Hediff_BasePregnancy preg ? preg.babies.Count : 1; + + if (hediff is Hediff_BasePregnancy h) { - babycount = h.babies.Count; - string fetustex = h.babies?.FirstOrDefault()?.def.GetModExtension()?.fetusTexPath ?? "Fetus/Fetus_Default"; - if (h.GestationProgress < 0.2f) icon = comp.WombTex + "_Implanted"; - else if (h.GestationProgress < 0.3f) - { - if (h.babies?.First()?.def?.race?.FleshType == FleshTypeDefOf.Insectoid) icon += "Fetus/Insects/Insect_Early00"; - else icon += "Fetus/Fetus_Early00"; - } - else if (h.GestationProgress < 0.4f) icon += fetustex + "00"; - else if (h.GestationProgress < 0.5f) icon += fetustex + "01"; - else if (h.GestationProgress < 0.6f) icon += fetustex + "02"; - else if (h.GestationProgress < 0.7f) icon += fetustex + "03"; - else if (h.GestationProgress < 0.8f) icon += fetustex + "04"; - else icon += fetustex + "05"; + babydef = h.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human; } - // TODO: Biotech - else icon = "Fetus/Slime_Abomi02"; + + fetustex = babydef.GetModExtension()?.fetusTexPath ?? "Fetus/Fetus_Default"; + if (gestationProgress < 0.2f) icon = comp.WombTex + "_Implanted"; + else if (gestationProgress < 0.3f) + { + if (babydef.race?.FleshType == FleshTypeDefOf.Insectoid) icon = "Fetus/Insects/Insect_Early00"; + else icon = "Fetus/Fetus_Early00"; + } + else if (gestationProgress < 0.4f) icon = fetustex + "00"; + else if (gestationProgress < 0.5f) icon = fetustex + "01"; + else if (gestationProgress < 0.6f) icon = fetustex + "02"; + else if (gestationProgress < 0.7f) icon = fetustex + "03"; + else if (gestationProgress < 0.8f) icon = fetustex + "04"; + else icon = fetustex + "05"; Texture2D result = TryGetTwinsIcon(icon, babycount); diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs index 8c71bf4..e640659 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs @@ -57,15 +57,16 @@ namespace RJW_Menstruation comp.TotalFertCum, comp.ovarypower, comp.GetNumOfEggs); } else description.AppendFormat("{0}\n", comp.GetCurStageLabel); - if (pawn.IsRJWPregnant()) + if (pawn.IsRJWPregnant() || pawn.IsBiotechPregnant()) { - Hediff_BasePregnancy hediff = comp.Pregnancy; + Hediff hediff = comp.Pregnancy; if (hediff != null && Utility.ShowFetusImage(hediff)) { icon = comp.GetPregnancyIcon(hediff); - if (hediff is Hediff_BasePregnancy h) + float gestationProgress = comp.StageProgress; + if (hediff is Hediff_BasePregnancy || hediff is HediffWithParents) { - if (h.GestationProgress < 0.2f) icon_overay = comp.GetCumIcon(); + if (gestationProgress < 0.2f) icon_overay = comp.GetCumIcon(); else icon_overay = ContentFinder.Get(("Womb/Empty"), true); } else icon_overay = ContentFinder.Get(("Womb/Empty"), true); diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs index bc6fc10..e90643b 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs @@ -217,8 +217,26 @@ namespace RJW_Menstruation GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + father + " ", fontstyleright); } } + else if (hediff is HediffWithParents p) + { + if (p is Hediff_Pregnant hp && hp.Severity < 0.2f) cum = comp.GetCumIcon(); + else cum = ContentFinder.Get("Womb/Empty", true); + // TODO: Pregenerated babies (base on multiplepregnancy) + if (Utility.ShowFetusInfo()) + { + preginfoheight = fontheight; + Rect preginfo = new Rect(0f, mainRect.yMax - wombRectHeight - 2, wombRectWidth, preginfoheight); + fontstyleright.normal.textColor = Color.white; + fontstyleright.alignment = TextAnchor.MiddleRight; + buttonstyle.alignment = TextAnchor.MiddleLeft; + + string father = p.Father.LabelShort; + + GUI.Box(preginfo, "1 " + p.Mother.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); + GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + father + " ", fontstyleright); + } + } else cum = ContentFinder.Get(("Womb/Empty"), true); - // TODO: Biotech pregnancy } else { diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Utility.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Utility.cs index 23a56d7..aefa4c2 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Utility.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Utility.cs @@ -188,7 +188,7 @@ namespace RJW_Menstruation return null; } } - // TODO: Biotech + // TODO: Biotech pregenerated babies return null; }