This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Changes

Jump to: navigation, search

Modding:Migrate to SMAPI 3.0

1,224 bytes removed, 05:33, 7 October 2018
Event changes: reduce duplication
| Mods very rarely need to handle this, since SMAPI's translation and content APIs do. Since the locale can only change on the title screen, mods that used this can check once the save is loaded instead.
|-
| <tt>ControlEvents.ControllerButtonPressed</tt><br /><tt>ControlEvents.ControllerButtonReleased</tt><br /><tt>ControlEvents.ControllerTriggerPressed</tt><br /><tt>ControlEvents.ControllerTriggerReleased</tt>
| →
| <tt>Input.ButtonPressed</tt><br /><tt>Input.ButtonReleased</tt>
| Mostly equivalent.
* Remove <tt>e.PlayerIndex</tt> (this was always <tt>PlayerIndex.One</tt>).
* Change <tt>e.ButtonPressed</tt> to <tt>e.Button</tt>, which is now an [[Modding:Modder Guide/APIs/Utilities#Input|<tt>SButton</tt>]] value.
|-| <tt>ControlEvents.ControllerButtonReleased</tt>| →| <tt>Input.ButtonReleased</tt>| Mostly equivalent.* Remove <tt>e.PlayerIndex</tt> (this was always <tt>PlayerIndex.One</tt>).* Change <tt>e.ButtonPressed</tt> to <tt>e.Button</tt>, which is now an [[Modding:Modder Guide/APIs/Utilities#Input|<tt>SButton</tt>]] value. |-| <tt>ControlEvents.ControllerTriggerPressed</tt>| →| <tt>Input.ButtonPressed</tt>| Mostly equivalent.* Remove <tt>e.PlayerIndex</tt> (this was always <tt>PlayerIndex.One</tt>).* Remove <tt>e.Value</tt>.* Change <tt>e.ButtonPressed</tt> to <tt>e.Button</tt>, which is now an [[Modding:Modder Guide/APIs/Utilities#Input|<tt>SButton</tt>]] value.|-| <tt>ControlEvents.ControllerTriggerReleased</tt>| →| <tt>Input.ButtonReleased</tt>| Mostly equivalent.* Remove <tt>e.PlayerIndex</tt> (this was always <tt>PlayerIndex.One</tt>).* Remove <tt>e.Value</tt>.* Change <tt>e.ButtonPressed</tt> to <tt>e.Button</tt>, which is now an [[Modding:Modder Guide/APIs/Utilities#Input|<tt>SButton</tt>]] valuefor trigger events.
|-
| <tt>ControlEvents.KeyboardChanged</tt>
| Not directly equivalent; may need to rewrite affected code.
|-
| <tt>ControlEvents.KeyPressed</tt><br /><tt>ControlEvents.KeyReleased</tt>
| →
| <tt>Input.ButtonPressed</tt>| Mostly equivalent.* Change <tt>e.KeyPressed</tt> to <tt>e.Button</tt>, which is now an [[Modding:Modder Guide/APIs/Utilities#Input|<tt>SButton</tt>]] value.|-| <tt>ControlEvents.KeyReleased<br /tt>| →| <tt>Input.ButtonReleased</tt>
| Mostly equivalent.
* Change <tt>e.KeyPressed</tt> to <tt>e.Button</tt>, which is now an [[Modding:Modder Guide/APIs/Utilities#Input|<tt>SButton</tt>]] value.
|
|-
| <tt>InputEvents.ButtonPressed</tt><br /><tt>InputEvents.ButtonReleased</tt>
| →
| <tt>Input.ButtonPressed</tt>| Mostly equivalent.* Change <tt>e.IsActionButton</tt> to <tt>e.Button.IsActionButton()</tt>.* Change <tt>e.IsUseToolButton</tt> to <tt>e.Button.IsUseToolButton()</tt>.* Change <tt>e.SuppressButton</tt> to <tt>this.Helper.Input.Suppress(button)</tt>.|-| <tt>InputEvents.ButtonReleased<br /tt>| →| <tt>Input.ButtonReleased</tt>
| Mostly equivalent.
* Change <tt>e.IsActionButton</tt> to <tt>e.Button.IsActionButton()</tt>.
Protected, translators
5,421
edits

Navigation menu