Changes

m
Text replacement - "tt>" to "samp>"
Line 8: Line 8:  
A SMAPI mod must have...
 
A SMAPI mod must have...
 
# a compiled DLL file which contains the code to run as part of the mod (see [[#Mod entry|''mod entry'' below]]);
 
# a compiled DLL file which contains the code to run as part of the mod (see [[#Mod entry|''mod entry'' below]]);
# a [[Modding:Modder Guide/APIs/Manifest|<tt>manifest.json</tt> file]] which describes the mod.
+
# a [[Modding:Modder Guide/APIs/Manifest|<samp>manifest.json</samp> file]] which describes the mod.
    
It may optionally have...
 
It may optionally have...
# any number of [[#Dependencies|compiled <tt>.dll</tt> and <tt>.pdb</tt> files referenced by the main mod DLL]];
+
# any number of [[#Dependencies|compiled <samp>.dll</samp> and <samp>.pdb</samp> files referenced by the main mod DLL]];
# an [[Modding:Modder Guide/APIs/Translation|<tt>i18n</tt> folder containing translations]];
+
# an [[Modding:Modder Guide/APIs/Translation|<samp>i18n</samp> folder containing translations]];
# any number of custom files used by the mod code (usually in an <tt>assets</tt> folder by convention).
+
# any number of custom files used by the mod code (usually in an <samp>assets</samp> folder by convention).
    
==Mod entry==
 
==Mod entry==
The main mod project must have a subclass of <tt>StardewModdingAPI.Mod</tt>. The class is often named <tt>ModEntry</tt> by convention, but you can use any valid C# name. The class must implement an <tt>Entry</tt> method, which SMAPI will call once the mod is loaded. The <tt>helper</tt> argument provides access to nearly all [[Modding:Modder Guide/APIs|SMAPI APIs]] (available as <tt>this.Helper</tt> in other methods).
+
The main mod project must have a subclass of <samp>StardewModdingAPI.Mod</samp>. The class is often named <samp>ModEntry</samp> by convention, but you can use any valid C# name. The class must implement an <samp>Entry</samp> method, which SMAPI will call once the mod is loaded. The <samp>helper</samp> argument provides access to nearly all [[Modding:Modder Guide/APIs|SMAPI APIs]] (available as <samp>this.Helper</samp> in other methods).
    
Here's the minimum possible implementation (which does nothing at all):
 
Here's the minimum possible implementation (which does nothing at all):
Line 34: Line 34:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
The <tt>Entry</tt> method is called very early in the launch process, so some things aren't initialised yet. You can use events like <tt>GameLaunched</tt>, <tt>SaveLoaded</tt>, or <tt>DayStarted</tt> to access all features. Here's a quick summary of using APIs in <tt>Entry</tt>:
+
The <samp>Entry</samp> method is called very early in the launch process, so some things aren't initialised yet. You can use events like <samp>GameLaunched</samp>, <samp>SaveLoaded</samp>, or <samp>DayStarted</samp> to access all features. Here's a quick summary of using APIs in <samp>Entry</samp>:
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 43: Line 43:  
| ✓ available. That includes [[Modding:Modder Guide/APIs/Events|registering event handlers]], [[Modding:Modder Guide/APIs/Config|reading configuration]], [[Modding:Modder Guide/APIs/Content|loading assets]], and [[Modding:Modder Guide/APIs/Integrations#Mod registry|fetching mod info]].
 
| ✓ available. That includes [[Modding:Modder Guide/APIs/Events|registering event handlers]], [[Modding:Modder Guide/APIs/Config|reading configuration]], [[Modding:Modder Guide/APIs/Content|loading assets]], and [[Modding:Modder Guide/APIs/Integrations#Mod registry|fetching mod info]].
 
|-
 
|-
| <tt>helper.ModRegistry.GetApi</tt>
+
| <samp>helper.ModRegistry.GetApi</samp>
 
| ✖ Not available, since some mods aren't initialised yet.
 
| ✖ Not available, since some mods aren't initialised yet.
 
|-
 
|-
 
| Game fields
 
| Game fields
| ✖ Not reliably available, since mods are loaded early in the process. That includes core fields like <tt>Game1.objectInformation</tt>.
+
| ✖ Not reliably available, since mods are loaded early in the process. That includes core fields like <samp>Game1.objectInformation</samp>.
 
|}
 
|}
  
106,033

edits