Alterações

sem resumo de edição
Linha 131: Linha 131:  
# <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 <samp>Mod</samp> class. SMAPI will detect your <samp>Mod</samp> subclass automatically, and <samp>Mod</samp> gives you access to SMAPI's APIs.
 
# <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 <samp>Mod</samp> class. SMAPI will detect your <samp>Mod</samp> subclass automatically, and <samp>Mod</samp> 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>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>helper.Events.Input.ButtonPressed += this.OnButtonPressed;</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 <samp>helper.Events.Input.ButtonPressed</samp> event), SMAPI will call your <samp>this.OnButtonPressed</samp> method. See [[Modding:Modder Guide/APIs/Events|events in the SMAPI reference]] for more info.
+
# <code>helper.Events.Input.ButtonPressed += this.OnButtonPressed;</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 <samp>helper.Events.Input.ButtonPressed</samp> event), SMAPI will call your <samp>this.OnButtonPressed</samp> method. See [[Modding:Modder Guide/APIs/Events|events in the SMAPI reference]] for more info.
    
===Add your manifest===
 
===Add your manifest===
Linha 194: Linha 194:     
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
// ✘ Don't do this! It will crash if SMAPI rewrites the assembly (e.g. to update or crossplatform it).
+
// ✘ Don't do this! It will crash if SMAPI rewrites the assembly (''e.g.,'' to update or crossplatform it).
 
string modFolder = Assembly.GetCallingAssembly().Location;
 
string modFolder = Assembly.GetCallingAssembly().Location;
  
105 831

edições