Changes

→‎Utilities: + context
Line 630: Line 630:  
==Utilities==
 
==Utilities==
 
SMAPI provides some C# objects you can use to simplify your code.
 
SMAPI provides some C# objects you can use to simplify your code.
 +
 +
===Context===
 +
The <tt>Context</tt> class provides properties about what the game is doing:
 +
 +
{| class="wikitable"
 +
|-
 +
! value
 +
! meaning
 +
|-
 +
| <tt>Context.IsWorldReady</tt>
 +
| Whether the player has loaded a save and the world has finished initialising. Useful for ignoring events before the save is loaded.
 +
|-
 +
| <tt>Context.IsPlayerFree</tt>
 +
| Whether the player is free to move around (e.g. save is loaded, no menu is displayed, no cutscene is in progress, etc).
 +
|}
    
===Dates===
 
===Dates===
translators
8,404

edits