private void OnTimeChanged(object?sender, TimeChangedEventArgs e) { MidDayScheduleEditor.AttemptAdjustGISchedule(e); if (e.NewTime > 615 && !this.haveFixedSchedulesToday) { // No longer need the exclusions cache. IslandSouthPatches.ClearCache(); ScheduleUtilities.FixUpSchedules(); if (Globals.Config.DebugMode) { ScheduleDebugPatches.FixNPCs(); } this.haveFixedSchedulesToday = true; } }
/// <summary> /// Applies and logs this mod's harmony patches. /// </summary> /// <param name="harmony">My harmony instance.</param> private void ApplyPatches(Harmony harmony) { try { // handle patches from annotations. harmony.PatchAll(); if (Globals.Config.DebugMode) { ScheduleDebugPatches.ApplyPatches(harmony); } } catch (Exception ex) { Globals.ModMonitor.Log($"{I18n.HarmonyCrash()} {Globals.GithubLocation}{Environment.NewLine}{ex}", LogLevel.Error); } harmony.Snitch(Globals.ModMonitor, this.ModManifest.UniqueID, transpilersOnly: true); }