43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using Omegasis.AutoSpeed.Framework;
|
|
using StardewModdingAPI;
|
|
using StardewModdingAPI.Events;
|
|
using StardewValley;
|
|
|
|
namespace Omegasis.AutoSpeed
|
|
{
|
|
/// <summary>The mod entry point.</summary>
|
|
public class AutoSpeed : Mod
|
|
{
|
|
/*********
|
|
** Fields
|
|
*********/
|
|
/// <summary>The mod configuration.</summary>
|
|
private ModConfig Config;
|
|
|
|
|
|
/*********
|
|
** 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>
|
|
public override void Entry(IModHelper helper)
|
|
{
|
|
helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked;
|
|
this.Config = helper.ReadConfig<ModConfig>();
|
|
}
|
|
|
|
|
|
/*********
|
|
** Private methods
|
|
*********/
|
|
/// <summary>Raised after the game state is updated (≈60 times per second).</summary>
|
|
/// <param name="sender">The event sender.</param>
|
|
/// <param name="e">The event arguments.</param>
|
|
private void OnUpdateTicked(object sender, UpdateTickedEventArgs e)
|
|
{
|
|
if (Context.IsPlayerFree)
|
|
Game1.player.addedSpeed = this.Config.Speed;
|
|
}
|
|
}
|
|
}
|