Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public override void Entry(StardewModdingAPI.IModHelper helper)
 {
     Logger.Instance.Initialize(this.Monitor);
     config      = helper.ReadConfig <ModConfig>();
     this.helper = helper;
     helper.Events.GameLoop.DayStarted += SetupAutoDoorCallbacks;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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);
 }
Esempio n. 5
0
        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()));
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
        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;
            }
        }
Esempio n. 8
0
 /// <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);
 }