2016-12-09 08:34:28 +08:00
|
|
|
|
using System;
|
2017-08-06 03:51:44 +08:00
|
|
|
|
using Omegasis.AutoSpeed.Framework;
|
2017-07-28 08:28:39 +08:00
|
|
|
|
using StardewModdingAPI;
|
2017-07-30 01:47:19 +08:00
|
|
|
|
using StardewModdingAPI.Events;
|
|
|
|
|
using StardewValley;
|
2016-12-09 08:34:28 +08:00
|
|
|
|
|
2017-07-28 08:28:39 +08:00
|
|
|
|
namespace Omegasis.AutoSpeed
|
2016-12-09 08:34:28 +08:00
|
|
|
|
{
|
2017-07-30 01:47:19 +08:00
|
|
|
|
/// <summary>The mod entry point.</summary>
|
2016-12-09 08:34:28 +08:00
|
|
|
|
public class AutoSpeed : Mod
|
|
|
|
|
{
|
2017-07-30 01:47:19 +08:00
|
|
|
|
/*********
|
|
|
|
|
** Properties
|
|
|
|
|
*********/
|
2017-08-06 03:51:44 +08:00
|
|
|
|
/// <summary>The mod configuration.</summary>
|
|
|
|
|
private ModConfig Config;
|
2017-07-30 01:47:19 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********
|
|
|
|
|
** Public methods
|
|
|
|
|
*********/
|
|
|
|
|
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
|
|
|
|
|
/// <param name="helper">Provides simplified APIs for writing mods.</param>
|
2016-12-09 08:34:28 +08:00
|
|
|
|
public override void Entry(IModHelper helper)
|
|
|
|
|
{
|
2017-07-30 01:47:19 +08:00
|
|
|
|
GameEvents.UpdateTick += this.GameEvents_UpdateTick;
|
2017-08-06 03:51:44 +08:00
|
|
|
|
this.Config = helper.ReadConfig<ModConfig>();
|
2016-12-09 08:34:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
2017-07-30 01:47:19 +08:00
|
|
|
|
|
|
|
|
|
/*********
|
|
|
|
|
** Private methods
|
|
|
|
|
*********/
|
|
|
|
|
/// <summary>The method invoked when the game updates (roughly 60 times per second).</summary>
|
|
|
|
|
/// <param name="sender">The event sender.</param>
|
|
|
|
|
/// <param name="e">The event data.</param>
|
2016-12-09 08:34:28 +08:00
|
|
|
|
private void GameEvents_UpdateTick(object sender, EventArgs e)
|
|
|
|
|
{
|
2017-08-06 03:23:10 +08:00
|
|
|
|
if (Context.IsPlayerFree)
|
2017-08-06 03:51:44 +08:00
|
|
|
|
Game1.player.addedSpeed = this.Config.Speed;
|
2016-12-09 08:34:28 +08:00
|
|
|
|
}
|
2017-07-30 01:47:19 +08:00
|
|
|
|
}
|
|
|
|
|
}
|