Changes

Jump to navigation Jump to search
→‎Tracking changes to a value: fix awkward word choice
Line 6: Line 6:  
==Basic techniques==
 
==Basic techniques==
 
===Tracking changes to a value===
 
===Tracking changes to a value===
Mods often need to know when a value changed. If there's no SMAPI event for the value, you can create a private [https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/fields field] to track the value, and update it using the update tick event. For example, here's a full functional mod which prints a console message when the player's stamina changes:
+
Mods often need to know when a value changed. If there's no SMAPI event for the value, you can create a private [https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/fields field] to track the value, and update it using the update tick event. For example, here's a fully functional mod which prints a console message when the player's stamina changes:
    
<source lang="c#">
 
<source lang="c#">
translators
8,403

edits

Navigation menu