Show the status button in the health tab for pawns with a vagina as a second hediff.

This commit is contained in:
lutepickle 2022-05-28 17:53:20 -07:00
parent e170b5fa47
commit b6f220b30b
3 changed files with 12 additions and 1 deletions

Binary file not shown.

View file

@ -89,11 +89,21 @@ namespace RJW_Menstruation
public const float buttonWidth = 50f;
public const float buttonHeight = 20f;
private static HediffComp_Menstruation GetFirstMenstruation(IEnumerable<Hediff> diffs, float rectWidth)
{
foreach (Hediff diff in diffs)
{
HediffComp_Menstruation comp = diff.GetMenstruationComp();
if (comp != null) return comp;
}
return null;
}
public static void Prefix(Rect rect, Pawn pawn, IEnumerable<Hediff> diffs, ref float curY)
{
if (Configurations.EnableButtonInHT && pawn.ShowStatus())
{
HediffComp_Menstruation comp = diffs.First().GetMenstruationComp();
HediffComp_Menstruation comp = GetFirstMenstruation(diffs, rect.width * 0.625f);
if (comp != null)
{
Rect buttonrect = new Rect((rect.xMax) / 2 - 5f, curY + 2f, buttonWidth, buttonHeight);

View file

@ -1,6 +1,7 @@
Version 1.0.6.3
- Fix pawn generation for races with a single lifestage.
- Show womb gizmo for males with vaginas, too.
- Show the status button in the health tab for pawns with more than one genital.
Version 1.0.6.2
- Fix error/crash when a pawn in estrus (with hookup override enabled) looks for partners.