public override void Entry(IModHelper helper) { conf = Helper.ReadConfig <LevelingConfig>(); if (conf.combatExperienceFactor < 0 || conf.farmingExperienceFactor < 0 || conf.fishingExperienceFactor < 0 || conf.foragingExperienceFactor < 0 || conf.miningExperienceFactor < 0 || conf.generalExperienceFactor < 0) { Monitor.Log("ExperienceFactors in config.json must be at least 0", LogLevel.Error); Monitor.Log("Deactivating mod", LogLevel.Error); return; } Helper.Events.GameLoop.DayStarted += GameLoop_DayStarted; Helper.Events.GameLoop.UpdateTicked += GameLoop_UpdateTicked; Helper.Events.Display.RenderedWorld += Display_RenderedWorld; /* * Helper.ConsoleCommands.Add("setexp", "", HandleSetExp); * Helper.ConsoleCommands.Add("resetlevels", "", (arg, args) => * { * for (int skill = 0; skill < SKILL_COUNT; skill++) * { * int exp = Game1.player.experiencePoints[skill]; * SetLevel(skill, exp); * } * }); */ }
void GameLoop_DayStarted(object sender, StardewModdingAPI.Events.DayStartedEventArgs e) { conf = Helper.ReadConfig <LevelingConfig>(); SetOldExpArray(); }