private static void GetMenstruationOverridePrefix() { if (_lastHeroine != null) { // Get a schedule directly this way since the controller is not spawned in class roster var schedule = _lastHeroine.GetRelatedChaFiles() .Select(c => PregnancyData.Load(ExtendedSave.GetExtendedDataById(c, GUID))?.MenstruationSchedule ?? MenstruationSchedule.Default) .FirstOrDefault(x => x != MenstruationSchedule.Default); _menstruationsBackup = HFlag.menstruations; HFlag.menstruations = PregnancyCharaController.GetMenstruationsArr(schedule); } }
private static void GetMenstruationOverridePrefix() { if (_lastHeroine != null) { // Get a schedule directly this way since the controller is not spawned in class roster var schedule = _lastHeroine.GetRelatedChaFiles().Select(control => { var d = ExtendedSave.GetExtendedDataById(control, GUID); if (d == null) { return(PregnancyDataUtils.MenstruationSchedule.Default); } PregnancyDataUtils.DeserializeData(d, out _, out _, out _, out var s); return(s); }).FirstOrDefault(x => x != PregnancyDataUtils.MenstruationSchedule.Default); _menstruationsBackup = HFlag.menstruations; HFlag.menstruations = PregnancyCharaController.GetMenstruationsArr(schedule); } }