Changes

Jump to navigation Jump to search
clarifying
Line 753: Line 753:  
==Advanced==
 
==Advanced==
 
===Change monitoring===
 
===Change monitoring===
You may want to handle a change that doesn't have its own event (''e.g.,'' an in-game event ends, a letter is added to the mailbox, etc). You can usually do that by handling a general event like [[#GameLoop.UpdateTicked|<samp>UpdateTicked</samp>]], and detecting when the value(s) you're watching changed. For example, here's a complete mod which logs a message when an in-game event ends:
+
You may want to handle a change that doesn't have its own event (''e.g.,'' an NPC's heart event ends, a letter is added to the mailbox, etc). You can usually do that by handling a general event like [[#GameLoop.UpdateTicked|<samp>UpdateTicked</samp>]], and detecting when the value(s) you're watching changed. For example, here's a complete mod which logs a message when an in-game event ends:
 
<syntaxhighlight lang="c#">
 
<syntaxhighlight lang="c#">
 
/// <summary>The main entry point for the mod.</summary>
 
/// <summary>The main entry point for the mod.</summary>
307

edits

Navigation menu