//private static MedicalCareCategory GetMedicalCareCategory(Thing billGiver) public static void Postfix(ref MedicalCareCategory __result, Thing billGiver) { if (billGiver is Pawn p && SurgeryUnlimitedGameComponent.Get().surgeryUnlimited.Contains(p)) { __result = MedicalCareCategory.Best; } }
public override void DoCell(Rect rect, Pawn pawn, PawnTable table) { SurgeryUnlimitedGameComponent comp = SurgeryUnlimitedGameComponent.Get(); bool enabled = comp.surgeryUnlimited.Contains(pawn); Widgets.Checkbox(rect.position, ref enabled, rect.width); comp.Set(pawn, enabled); }
public static void Postfix(Pawn_PlayerSettings __instance, Pawn ___pawn) { if (Scribe.mode == LoadSaveMode.LoadingVars) { return; } Pawn pawn = ___pawn; SurgeryUnlimitedGameComponent comp = SurgeryUnlimitedGameComponent.Get(); comp?.Set(pawn, comp.surgeryUnlimitedDefault); }
public static void DrawSurgeryOption(Rect leftRect, Pawn pawn, ref float curY) { if (pawn.playerSettings != null && !pawn.Dead && Current.ProgramState == ProgramState.Playing) { bool selfTend = pawn.playerSettings.selfTend; Rect rect2 = new Rect(0f, curY, leftRect.width, 24f); SurgeryUnlimitedGameComponent comp = SurgeryUnlimitedGameComponent.Get(); bool surgeryUnlimited = comp.surgeryUnlimited.Contains(pawn); Widgets.CheckboxLabeled(rect2, "TD.PawnSettingSurgeryUnlimited".Translate(), ref surgeryUnlimited); comp.Set(pawn, surgeryUnlimited); curY += 28f; } }
public override int Compare(Pawn a, Pawn b) { int ret = 0; SurgeryUnlimitedGameComponent comp = SurgeryUnlimitedGameComponent.Get(); if (comp.surgeryUnlimited.Contains(a)) { ret++; } if (comp.surgeryUnlimited.Contains(b)) { ret--; } return(ret); }
//public override void DoWindowContents(Rect inRect) public static void Postfix(Rect inRect) { Rect botRect = inRect.BottomPartPixels(Text.LineHeight); botRect.y -= 40f; //CloseButSize Widgets.CheckboxLabeled(botRect, "TD.DefaultSurgeryUnlimited".Translate(), ref SurgeryUnlimitedGameComponent.Get().surgeryUnlimitedDefault); }