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(); if (comp != null) { Rect buttonrect = new Rect((rect.xMax) / 2 - 5f, curY + 2f, buttonWidth, buttonHeight); if (Widgets.ButtonText(buttonrect, Translations.Button_HealthTab)) { Dialog_WombStatus.ToggleWindow(pawn, comp); } } } }
private static Gizmo CreateGizmo_WombStatus(Pawn pawn, HediffComp_Menstruation comp) { Texture2D icon, icon_overay; string description = ""; if (Configurations.Debug) { description += comp.curStage + ": " + comp.curStageHrs + "\n" + "fertcums: " + comp.TotalFertCum + "\n" + "ovarypower: " + comp.ovarypower + "\n" + "eggs: " + comp.GetNumofEggs + "\n"; } else { description += comp.GetCurStageLabel + "\n"; } if (pawn.IsPregnant()) { Hediff hediff = PregnancyHelper.GetPregnancy(pawn); if (Utility.ShowFetusImage((Hediff_BasePregnancy)hediff)) { icon = comp.GetPregnancyIcon(hediff); if (hediff is Hediff_BasePregnancy) { Hediff_BasePregnancy h = (Hediff_BasePregnancy)hediff; 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 = comp.GetWombIcon(); icon_overay = comp.GetCumIcon(); } } else { Hediff hediff = pawn.health.hediffSet.GetHediffs <Hediff_InsectEgg>().FirstOrDefault(); if (hediff != null) { icon = ContentFinder <Texture2D> .Get(("Womb/Womb_Egged"), true); icon_overay = ContentFinder <Texture2D> .Get(("Womb/Empty"), true); } else { icon = comp.GetWombIcon(); icon_overay = comp.GetCumIcon(); } } foreach (string s in comp.GetCumsInfo) { description += s + "\n"; } Color c = comp.GetCumMixtureColor; Gizmo gizmo = new Gizmo_Womb { defaultLabel = pawn.LabelShort, defaultDesc = description, icon = icon, icon_overay = icon_overay, shrinkable = Configurations.AllowShrinkIcon, cumcolor = c, comp = comp, order = 100, hotKey = VariousDefOf.OpenStatusWindowKey, action = delegate { Dialog_WombStatus.ToggleWindow(pawn, comp); } }; return(gizmo); }