mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Update GetPregnancyIcon for non-RJW pregnancies
This commit is contained in:
parent
31c3026ca0
commit
c72ff42da1
2 changed files with 25 additions and 23 deletions
|
@ -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;
|
||||
|
|
|
@ -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<Texture2D>.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;
|
||||
|
||||
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<PawnDNAModExtension>()?.fetusTexPath ?? "Fetus/Fetus_Default";
|
||||
if (h.GestationProgress < 0.2f) icon = comp.WombTex + "_Implanted";
|
||||
else if (h.GestationProgress < 0.3f)
|
||||
babydef = h.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human;
|
||||
}
|
||||
|
||||
fetustex = babydef.GetModExtension<PawnDNAModExtension>()?.fetusTexPath ?? "Fetus/Fetus_Default";
|
||||
if (gestationProgress < 0.2f) icon = comp.WombTex + "_Implanted";
|
||||
else if (gestationProgress < 0.3f)
|
||||
{
|
||||
if (h.babies?.First()?.def?.race?.FleshType == FleshTypeDefOf.Insectoid) icon += "Fetus/Insects/Insect_Early00";
|
||||
else icon += "Fetus/Fetus_Early00";
|
||||
if (babydef.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";
|
||||
}
|
||||
// TODO: Biotech
|
||||
else icon = "Fetus/Slime_Abomi02";
|
||||
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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue