Changes

Jump to navigation Jump to search
→‎Events (SMAPI 3.0): + specialised events
Line 472: Line 472:  
  |arg type 3 = <tt>IEnumerable&lt;KeyValuePair&lt;Vector2, TerrainFeature&gt;&gt;</tt>
 
  |arg type 3 = <tt>IEnumerable&lt;KeyValuePair&lt;Vector2, TerrainFeature&gt;&gt;</tt>
 
  |arg desc 3 = A list of [[Modding:Modder Guide/Game Fundamentals#Tiles|tile coordinate]] + terrain feature pairs removed since the last update tick.
 
  |arg desc 3 = A list of [[Modding:Modder Guide/Game Fundamentals#Tiles|tile coordinate]] + terrain feature pairs removed since the last update tick.
 +
}}
 +
|}
 +
 +
===Specialised===
 +
<tt>this.Helper.Events.Specialised</tt> has events for specialised edge cases. These shouldn't be used by most mods.
 +
 +
{| class="wikitable"
 +
|-
 +
! event
 +
! summary
 +
{{/event
 +
|name = UnvalidatedUpdateTicking, UnvalidatedUpdateTicked
 +
|desc = Raised before/after the game updates its state (≈60 times per second), regardless of normal SMAPI validation. This event is not thread-safe and may be invoked while game logic is running asynchronously. Changes to game state in this method may crash the game or corrupt an in-progress save. '''Do not use this event unless you're fully aware of the context in which your code will be run. Using this event will trigger a warning in the SMAPI console.'''
 +
 +
 +
|arg name 1 = <tt>e.Ticks</tt>
 +
|arg type 1 = <tt>int</tt>
 +
|arg desc 1 = The number of ticks elapsed since the game started, including the current tick.
 +
 +
|arg name 2 = <tt>e.IsOneSecond</tt>
 +
|arg type 2 = <tt>bool</tt>
 +
|arg desc 2 = Whether <tt>e.TicksElapsed</tt> is a multiple of 60, which happens approximately once per second.
 +
 +
|arg name 3 = <tt>e.IsMultipleOf(int number)</tt>
 +
|arg type 3 = ''method'' returns <tt>bool</tt>
 +
|arg desc 3 = Whether <tt>e.TicksElapsed</tt> is a multiple of the given number. This is mainly useful if you want to run logic intermittently (e.g. <code>e.IsMultipleOf(30)</code> for every half-second).
 
}}
 
}}
 
|}
 
|}
translators
8,441

edits

Navigation menu