Changes

no edit summary
Line 7: Line 7:  
The SMAPI console is the window that opens alongside the game, which displays messages from SMAPI and mods in a text-only format. Players can enter commands directly into that window to interact with mods. For example, you can type <samp>help</samp> to see a list of available commands. Note that most players aren't comfortable with a command-line interface, so you should prefer in-game interfaces for player-facing features in most cases.
 
The SMAPI console is the window that opens alongside the game, which displays messages from SMAPI and mods in a text-only format. Players can enter commands directly into that window to interact with mods. For example, you can type <samp>help</samp> to see a list of available commands. Note that most players aren't comfortable with a command-line interface, so you should prefer in-game interfaces for player-facing features in most cases.
   −
[[File:smapi-console-window.png|thumb|none|The SMAPI console window with some example mods.]]
+
[[File:smapi-console-window.png|thumb|none|The SMAPI console window with example mods (for the non-developer version of SMAPI).]]
    
==Add a custom command==
 
==Add a custom command==
Line 39: Line 39:  
     private void SetMoney(string command, string[] args)
 
     private void SetMoney(string command, string[] args)
 
     {
 
     {
         Game1.player.money = int.Parse(args[0]);
+
         Game1.player.Money = int.Parse(args[0]);
 
         this.Monitor.Log($"OK, set your money to {args[0]}.", LogLevel.Info);
 
         this.Monitor.Log($"OK, set your money to {args[0]}.", LogLevel.Info);
 
     }
 
     }
Line 59: Line 59:  
==See also==
 
==See also==
 
* [[Modding:Modder Guide/APIs/Integrations|Integration APIs]]
 
* [[Modding:Modder Guide/APIs/Integrations|Integration APIs]]
 +
* [[Modding:Modder Guide/APIs/Logging|Logging API]]
 +
 +
[[zh:模组:制作指南/APIs/Console]]
106,449

edits