Compare commits

..

No commits in common. "592cb361adf8bc248b87ea5d0a53402bcbd75a19" and "31c3026ca055858191859f82ba3b31053a62ea9c" have entirely different histories.

7 changed files with 28 additions and 49 deletions

Binary file not shown.

View file

@ -550,7 +550,8 @@ namespace RJW_Menstruation
break; break;
case Hediff_Labor _: case Hediff_Labor _:
case Hediff_LaborPushing _: case Hediff_LaborPushing _:
return 1.0f; is_discovered = true;
break;
} }
if (is_discovered || Configurations.infoDetail == Configurations.DetailLevel.All) return pregnancy.Severity; if (is_discovered || Configurations.infoDetail == Configurations.DetailLevel.All) return pregnancy.Severity;

View file

@ -89,34 +89,31 @@ namespace RJW_Menstruation
public static Texture2D GetPregnancyIcon(this HediffComp_Menstruation comp, Hediff hediff) public static Texture2D GetPregnancyIcon(this HediffComp_Menstruation comp, Hediff hediff)
{ {
string icon = "";
int babycount = 1;
if (hediff is Hediff_MechanoidPregnancy) if (hediff is Hediff_MechanoidPregnancy)
{
return ContentFinder<Texture2D>.Get(("Womb/Mechanoid_Fluid"), true); return ContentFinder<Texture2D>.Get(("Womb/Mechanoid_Fluid"), true);
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)
{
babydef = h.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human;
} }
else if (hediff is Hediff_BasePregnancy h)
fetustex = babydef.GetModExtension<PawnDNAModExtension>()?.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"; babycount = h.babies.Count;
else icon = "Fetus/Fetus_Early00"; string fetustex = h.babies?.FirstOrDefault()?.def.GetModExtension<PawnDNAModExtension>()?.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";
} }
else if (gestationProgress < 0.4f) icon = fetustex + "00"; // TODO: Biotech
else if (gestationProgress < 0.5f) icon = fetustex + "01"; else icon = "Fetus/Slime_Abomi02";
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); Texture2D result = TryGetTwinsIcon(icon, babycount);

View file

@ -57,16 +57,15 @@ namespace RJW_Menstruation
comp.TotalFertCum, comp.ovarypower, comp.GetNumOfEggs); comp.TotalFertCum, comp.ovarypower, comp.GetNumOfEggs);
} }
else description.AppendFormat("{0}\n", comp.GetCurStageLabel); else description.AppendFormat("{0}\n", comp.GetCurStageLabel);
if (pawn.IsRJWPregnant() || pawn.IsBiotechPregnant()) if (pawn.IsRJWPregnant())
{ {
Hediff hediff = comp.Pregnancy; Hediff_BasePregnancy hediff = comp.Pregnancy;
if (hediff != null && Utility.ShowFetusImage(hediff)) if (hediff != null && Utility.ShowFetusImage(hediff))
{ {
icon = comp.GetPregnancyIcon(hediff); icon = comp.GetPregnancyIcon(hediff);
float gestationProgress = comp.StageProgress; if (hediff is Hediff_BasePregnancy h)
if (hediff is Hediff_BasePregnancy || hediff is HediffWithParents)
{ {
if (gestationProgress < 0.2f) icon_overay = comp.GetCumIcon(); if (h.GestationProgress < 0.2f) icon_overay = comp.GetCumIcon();
else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true); else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
} }
else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true); else icon_overay = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);

View file

@ -217,26 +217,8 @@ namespace RJW_Menstruation
GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + father + " ", fontstyleright); 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<Texture2D>.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<Texture2D>.Get(("Womb/Empty"), true); else cum = ContentFinder<Texture2D>.Get(("Womb/Empty"), true);
// TODO: Biotech pregnancy
} }
else else
{ {

View file

@ -188,7 +188,7 @@ namespace RJW_Menstruation
return null; return null;
} }
} }
// TODO: Biotech pregenerated babies // TODO: Biotech
return null; return null;
} }