diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-07-08 20:06:33 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-07-08 20:06:33 -0400 |
commit | 3b078d55daccd13332e2cba1fd5c76f775505d7a (patch) | |
tree | 47a531276effb17a60dbec2a5ae2220102129b3b /src/SMAPI/Framework/Events/EventManager.cs | |
parent | 7e46cc24630d810f4e2396346124780160cb7aa3 (diff) | |
download | SMAPI-3b078d55daccd13332e2cba1fd5c76f775505d7a.tar.gz SMAPI-3b078d55daccd13332e2cba1fd5c76f775505d7a.tar.bz2 SMAPI-3b078d55daccd13332e2cba1fd5c76f775505d7a.zip |
add GameLoop events for SMAPI 3.0 (#310)
Diffstat (limited to 'src/SMAPI/Framework/Events/EventManager.cs')
-rw-r--r-- | src/SMAPI/Framework/Events/EventManager.cs | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs index b05d82ce..3d5d0124 100644 --- a/src/SMAPI/Framework/Events/EventManager.cs +++ b/src/SMAPI/Framework/Events/EventManager.cs @@ -12,6 +12,33 @@ namespace StardewModdingAPI.Framework.Events ** Events (new) *********/ /**** + ** Game loop + ****/ + /// <summary>Raised after the game is launched, right before the first update tick.</summary> + public readonly ManagedEvent<GameLoopLaunchedEventArgs> GameLoop_Launched; + + /// <summary>Raised before the game performs its overall update tick (≈60 times per second).</summary> + public readonly ManagedEvent<GameLoopUpdatingEventArgs> GameLoop_Updating; + + /// <summary>Raised after the game performs its overall update tick (≈60 times per second).</summary> + public readonly ManagedEvent<GameLoopUpdatedEventArgs> GameLoop_Updated; + + /**** + ** Input + ****/ + /// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary> + public readonly ManagedEvent<InputButtonPressedArgsInput> Input_ButtonPressed; + + /// <summary>Raised after the player released a button on the keyboard, controller, or mouse.</summary> + public readonly ManagedEvent<InputButtonReleasedArgsInput> Input_ButtonReleased; + + /// <summary>Raised after the player moves the in-game cursor.</summary> + public readonly ManagedEvent<InputCursorMovedArgsInput> Input_CursorMoved; + + /// <summary>Raised after the player scrolls the mouse wheel.</summary> + public readonly ManagedEvent<InputMouseWheelScrolledEventArgs> Input_MouseWheelScrolled; + + /**** ** World ****/ /// <summary>Raised after a game location is added or removed.</summary> @@ -35,21 +62,6 @@ namespace StardewModdingAPI.Framework.Events /// <summary>Raised after terrain features (like floors and trees) are added or removed in a location.</summary> public readonly ManagedEvent<WorldTerrainFeatureListChangedEventArgs> World_TerrainFeatureListChanged; - /**** - ** Input - ****/ - /// <summary>Raised after the player presses a button on the keyboard, controller, or mouse.</summary> - public readonly ManagedEvent<InputButtonPressedArgsInput> Input_ButtonPressed; - - /// <summary>Raised after the player released a button on the keyboard, controller, or mouse.</summary> - public readonly ManagedEvent<InputButtonReleasedArgsInput> Input_ButtonReleased; - - /// <summary>Raised after the player moves the in-game cursor.</summary> - public readonly ManagedEvent<InputCursorMovedArgsInput> Input_CursorMoved; - - /// <summary>Raised after the player scrolls the mouse wheel.</summary> - public readonly ManagedEvent<InputMouseWheelScrolledEventArgs> Input_MouseWheelScrolled; - /********* ** Events (old) @@ -252,6 +264,9 @@ namespace StardewModdingAPI.Framework.Events ManagedEvent ManageEvent(string typeName, string eventName) => new ManagedEvent($"{typeName}.{eventName}", monitor, modRegistry); // init events (new) + this.GameLoop_Updating = ManageEventOf<GameLoopUpdatingEventArgs>(nameof(IModEvents.GameLoop), nameof(IGameLoopEvents.Updating)); + this.GameLoop_Updated = ManageEventOf<GameLoopUpdatedEventArgs>(nameof(IModEvents.GameLoop), nameof(IGameLoopEvents.Updated)); + this.Input_ButtonPressed = ManageEventOf<InputButtonPressedArgsInput>(nameof(IModEvents.Input), nameof(IInputEvents.ButtonPressed)); this.Input_ButtonReleased = ManageEventOf<InputButtonReleasedArgsInput>(nameof(IModEvents.Input), nameof(IInputEvents.ButtonReleased)); this.Input_CursorMoved = ManageEventOf<InputCursorMovedArgsInput>(nameof(IModEvents.Input), nameof(IInputEvents.CursorMoved)); |