/// <summary>The mod entry point, called after the mod is first loaded.</summary> /// <param name="helper">Provides simplified APIs for writing mods.</param> public override void Entry(IModHelper helper) { Config = helper.ReadConfig <SNConfiguration>(); harvestableNotification = new HarvestNotification(Helper.Translation); generalNotification = new GeneralNotification(); productionNotification = new ProductionNotification(); helper.Events.GameLoop.DayStarted += OnDayStarted; helper.Events.Player.Warped += OnWarped; helper.Events.GameLoop.TimeChanged += OnTimeChanged; }
/// <summary>Raised after the in-game clock time changes.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnTimeChanged(object sender, TimeChangedEventArgs e) { if (Config.NotifyBirthdayReminder && e.NewTime == Config.BirthdayReminderTime) { GeneralNotification.DoBirthdayReminder(Helper.Translation); } if (Config.ShowWeatherNextDay && e.NewTime == Config.WeatherNextDayTime) { GeneralNotification.DoWeatherReminder(Helper.Translation); } }
public override void Entry(IModHelper helper) { Util.Config = helper.ReadConfig <Configuration>(); Util.Monitor = Monitor; harvestableNotification = new HarvestNotification(); generalNotification = new GeneralNotification(); productionNotification = new ProductionNotification(); #pragma warning disable 0618 PlayerEvents.LoadedGame += ReceiveLoadedGame; MenuEvents.MenuClosed += ReceiveMenuClosed; TimeEvents.TimeOfDayChanged += ReceiveTimeOfDayChanged; LocationEvents.CurrentLocationChanged += ReceiveCurrentLocationChanged; }
public override void Entry(IModHelper helper) { Util.Config = helper.ReadConfig <Configuration>(); Util.Monitor = Monitor; harvestableNotification = new HarvestNotification(); generalNotification = new GeneralNotification(); productionNotification = new ProductionNotification(); SaveEvents.AfterLoad += ReceiveLoadedGame; //MenuEvents.MenuClosed += ReceiveMenuClosed; TimeEvents.AfterDayStarted += DailyNotifications; TimeEvents.TimeOfDayChanged += ReceiveTimeOfDayChanged; LocationEvents.CurrentLocationChanged += ReceiveCurrentLocationChanged; }
/// <summary>Raised after the in-game clock time changes.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> private void OnTimeChanged(object sender, TimeChangedEventArgs e) { // send daily notifications if (Config.RunNotificationsTime != 600 && Config.RunNotificationsTime == e.NewTime) { generalNotification.DoNewDayNotifications(Helper.Translation); harvestableNotification.CheckHarvestsAroundFarm(); } if (Config.NotifyBirthdayReminder && e.NewTime == Config.BirthdayReminderTime) { GeneralNotification.DoBirthdayReminder(Helper.Translation); } if (Config.ShowWeatherNextDay && e.NewTime == Config.WeatherNextDayTime) { GeneralNotification.DoWeatherReminder(Helper.Translation); } }