Compare commits

...

3 commits

Author SHA1 Message Date
ADHD_Coder
beefd30dbe Merge branch 'UI_vag_label_fix' into 'dev'
Fix UI so it displays the type of the linked vagina hediff

See merge request lutepickle/rjw_menstruation!14
2026-08-12 05:51:24 +00:00
lutepickle
d2f6562108 Apply vagina morph to Biotech births 2026-08-09 06:41:54 -07:00
ADHD_Coder
8ff3771a0e Fix UI so it displays the type of the vaginal the menstruationComp is linked to, instead of the first vagina the pawn has. 2025-11-17 13:55:13 -08:00
9 changed files with 15 additions and 4 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1,10 +1,12 @@
using HarmonyLib; using HarmonyLib;
using RimWorld; using RimWorld;
using rjw;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Reflection.Emit; using System.Reflection.Emit;
using UnityEngine;
using Verse; using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
@ -50,6 +52,14 @@ namespace RJW_Menstruation
{ {
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy(); HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (comp == null) return; if (comp == null) return;
if (Configurations.EnableBirthVaginaMorph)
{
HediffComp_SexPart vaginaComp = comp.parent?.TryGetComp<HediffComp_SexPart>();
if (vaginaComp == null) return;
float morph = Mathf.Max(LifeStageDefOf.HumanlikeBaby.bodySizeFactor - Mathf.Pow(vaginaComp.Size, 2), 0f);
vaginaComp.baseSize += morph * Configurations.VaginaMorphPower;
vaginaComp.UpdateSeverity();
}
comp.Pregnancy = null; comp.Pregnancy = null;
} }
} }

View file

@ -400,7 +400,7 @@ namespace RJW_Menstruation
GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit); GUI.DrawTexture(genitalIconRect, vagina, ScaleMode.ScaleToFit);
GUI.color = Color.white; GUI.color = Color.white;
GUI.Label(genitalVaginaLabelRect, pawn.GetVaginaLabel(), fontstylecenter); GUI.Label(genitalVaginaLabelRect, comp.GetVaginaLabel(), fontstylecenter);
GUI.Label(genitalAnusLabelRect, pawn.GetAnusLabel(), fontstylecenter); GUI.Label(genitalAnusLabelRect, pawn.GetAnusLabel(), fontstylecenter);
} }

View file

@ -325,10 +325,10 @@ namespace RJW_Menstruation
} }
public static string GetVaginaLabel(this Pawn pawn) public static string GetVaginaLabel(this HediffComp_Menstruation comp)
{ {
Hediff hediff = pawn.health.hediffSet.hediffs.Find(h => VariousDefOf.AllVaginas.Contains(h.def)); Hediff hediff = comp.parent;
return hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")" + "\n" + xxx.CountOfSex.LabelCap.CapitalizeFirst() + ": " + pawn.records.GetAsInt(xxx.CountOfSex); return hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")" + "\n" + xxx.CountOfSex.LabelCap.CapitalizeFirst() + ": " + comp.parent.pawn.records.GetAsInt(xxx.CountOfSex);
} }
public static string GetAnusLabel(this Pawn pawn) public static string GetAnusLabel(this Pawn pawn)
{ {

View file

@ -1,4 +1,5 @@
Version 1.6.2.5 Version 1.6.2.5
- The vagina morph after birth setting will now apply to Biotech pregnancies.
Version 1.6.2.4 Version 1.6.2.4
- Fix error on startup and missing womb status in RJW tab with RJW 6.1.4. - Fix error on startup and missing womb status in RJW tab with RJW 6.1.4.