public override void HackEntry(StardewModdingAPI.IModHelper helper) { // Sanitize config. if (config.SpreadChance < 1e-6 || config.DisableGrowth) { config.GrowEverywhere = false; } if (config.GrowthChance < 1e-6 || (config.DailyGrowth == 0 && config.MonthlyGrowth == 0)) { config.DisableGrowth = true; } if (config.DailyGrowth > 10) { config.DailyGrowth = 10; } if (config.MonthlyGrowth > 100) { config.MonthlyGrowth = 100; } // If iterations changed if (config.DailyGrowth != 1 || config.MonthlyGrowth != 40) { Patch((Farm f) => f.DayUpdate(0), Farm_DayUpdate); } Patch((GameLocation gl) => gl.growWeedGrass(0), GameLocation_growWeedGrass); }
public override void Entry(StardewModdingAPI.IModHelper helper) { Logger.Instance.Initialize(this.Monitor); config = helper.ReadConfig <ModConfig>(); this.helper = helper; helper.Events.GameLoop.DayStarted += SetupAutoDoorCallbacks; }
public override void Entry(StardewModdingAPI.IModHelper helper) { Logger.Instance.Initialize(this.Monitor); GenericMenuRegistry = new MenuRegistry(Helper); ModConfig.Instance = Helper.ReadConfig <ModConfig>(); helper.Events.GameLoop.DayStarted += SetupAutoDoorCallbacks; helper.Events.GameLoop.GameLaunched += SetupMenu; }
public PlatoHelper(StardewModdingAPI.IModHelper helper) { ModHelper = helper; SharedData = new SharedDataHelper(this); Harmony = new HarmonyHelper(this); Content = new ContentHelper(this); UI = new UIHelper(this); Lua = new LuaHelper(this); Presets = new PresetHelper(this); Utilities = new BasicUtils(this); }
public override void Entry(StardewModdingAPI.IModHelper helper) { Mod.instance = this; Log.Monitor = this.Monitor; this.Helper.Events.GameLoop.GameLaunched += this.OnGameLaunched; this.Helper.Events.GameLoop.GameLaunched += this.OnDayStarted; SpaceEvents.OnEventFinished += this.OnEventFinished; this.Helper.ConsoleCommands.Add("camera_add", "Add a camera to your inventory.", (cmd, args) => Game1.player.addItemByMenuIfNecessary(new CameraTool())); }
public override void HackEntry(StardewModdingAPI.IModHelper helper) { // Sanitize config. if (config.GrowthChance < 1e-6 || (config.DailyGrowth == 0 && config.MonthlyGrowth == 0)) { config.DisableGrowth = true; } if (config.DailyGrowth > 10) { config.DailyGrowth = 10; } if (config.MonthlyGrowth > 100) { config.MonthlyGrowth = 100; } Patch((GameLocation gl) => gl.HandleGrassGrowth(0), GameLocation_HandleGrassGrowth); Patch((GameLocation gl) => gl.growWeedGrass(0), GameLocation_growWeedGrass); }
public override void Entry(StardewModdingAPI.IModHelper helper) { base.Entry(helper); // Sanitize config. if (config.SpreadChance < 1e-6 || config.DisableGrowth) { config.GrowEverywhere = false; } if (config.GrowthChance < 1e-6 || (config.DailyGrowth == 0 && config.MonthlyGrowth == 0)) { config.DisableGrowth = true; } if (config.DailyGrowth > 10) { config.DailyGrowth = 10; } if (config.MonthlyGrowth > 100) { config.MonthlyGrowth = 100; } }
/// <summary> /// Registers all time modifying commands. /// </summary> /// <param name="helper"></param> public static void registerCommands(StardewModdingAPI.IModHelper helper) { helper.ConsoleCommands.Add("debug_world_settime", "Sets the in-game time to be any valid int. Allows for setting time to be early in the morning, i.e. 3 A.M", world_settime); helper.ConsoleCommands.Add("debug_world_modifytimetick", "Sets the time interval in seconds between 10-minute in-game update ticks.", world_modifyTimeTick); }