This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Changes

Jump to: navigation, search

Modding:Modder Guide/Get Started

12 bytes removed, 23:24, 9 December 2018
update for SMAPI 2.9
public override void Entry(IModHelper helper)
{
InputEventshelper.Events.Input.ButtonPressed += this.InputEvents_ButtonPressedOnButtonPressed;
}
** Private methods
*********/
/// <summary>The method invoked when Raised after the player presses a controller, button on the keyboard, controller, or mouse button.</summary>
/// <param name="sender">The event sender.</param>
/// <param name="e">The event data.</param>
private void InputEvents_ButtonPressedOnButtonPressed(object sender, EventArgsInput ButtonPressedEventArgs e)
{
// ignore if player hasn't loaded a save yet
# <code>public class ModEntry : Mod</code> (see [https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/class class keyword]) creates your mod's main class, and subclasses SMAPI's <tt>Mod</tt> class. SMAPI will detect your <tt>Mod</tt> subclass automatically, and <tt>Mod</tt> gives you access to SMAPI's APIs.
# <code>public override void Entry(IModHelper helper)</code> is the method SMAPI will call when your mod is loaded into the game. The <code>helper</code> provides convenient access to many of SMAPI's APIs.
# <code>InputEventshelper.Events.Input.ButtonPressed += this.InputEvents_ButtonPressedOnButtonPressed;</code> adds an 'event handler' (i.e. a method to call) when the button-pressed event happens. In other words, when a button is pressed (the <tt>InputEventshelper.Events.Input.ButtonPressed</tt> event), SMAPI will call your <tt>this.InputEvents_ButtonPressedOnButtonPressed</tt> method. See [[Modding:Modder Guide/APIs/Events|events in the SMAPI reference]] for more info.
===Add your manifest===
"UniqueID": "<your name>.<your project name>",
"EntryDll": "<your project name>.dll",
"MinimumApiVersion": "2.09",
"UpdateKeys": []
}
Protected, translators
5,421
edits

Navigation menu