Esempio n. 1
0
        /// <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;
        }
Esempio n. 2
0
        /// <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);
            }
        }
Esempio n. 3
0
        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;
        }
Esempio n. 4
0
        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;
        }
Esempio n. 5
0
        /// <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);
            }
        }