diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-10-06 00:51:45 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-10-06 00:51:45 -0400 |
commit | 79705448f57c962e9331fb802097c24d2424476c (patch) | |
tree | 06b15229f7f9089af864fa0f948f209bc5aec51a /src/SMAPI/Framework/Events | |
parent | 14fab29370310a762a000c50b23075326b4e95da (diff) | |
download | SMAPI-79705448f57c962e9331fb802097c24d2424476c.tar.gz SMAPI-79705448f57c962e9331fb802097c24d2424476c.tar.bz2 SMAPI-79705448f57c962e9331fb802097c24d2424476c.zip |
add DayEnding event (#310)
Diffstat (limited to 'src/SMAPI/Framework/Events')
-rw-r--r-- | src/SMAPI/Framework/Events/EventManager.cs | 4 | ||||
-rw-r--r-- | src/SMAPI/Framework/Events/ModGameLoopEvents.cs | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs index 023c45de..616db7d9 100644 --- a/src/SMAPI/Framework/Events/EventManager.cs +++ b/src/SMAPI/Framework/Events/EventManager.cs @@ -41,6 +41,9 @@ namespace StardewModdingAPI.Framework.Events /// <summary>Raised after the game begins a new day, including when loading a save.</summary> public readonly ManagedEvent<DayStartedEventArgs> DayStarted; + /// <summary>Raised before the game ends the current day. This happens before it starts setting up the next day and before <see cref="Saving"/>.</summary> + public readonly ManagedEvent<DayEndingEventArgs> DayEnding; + /**** ** Input ****/ @@ -291,6 +294,7 @@ namespace StardewModdingAPI.Framework.Events this.Saved = ManageEventOf<SavedEventArgs>(nameof(IModEvents.GameLoop), nameof(IGameLoopEvents.Saved)); this.SaveLoaded = ManageEventOf<SaveLoadedEventArgs>(nameof(IModEvents.GameLoop), nameof(IGameLoopEvents.SaveLoaded)); this.DayStarted = ManageEventOf<DayStartedEventArgs>(nameof(IModEvents.GameLoop), nameof(IGameLoopEvents.DayStarted)); + this.DayEnding = ManageEventOf<DayEndingEventArgs>(nameof(IModEvents.GameLoop), nameof(IGameLoopEvents.DayEnding)); this.ButtonPressed = ManageEventOf<ButtonPressedEventArgs>(nameof(IModEvents.Input), nameof(IInputEvents.ButtonPressed)); this.ButtonReleased = ManageEventOf<ButtonReleasedEventArgs>(nameof(IModEvents.Input), nameof(IInputEvents.ButtonReleased)); diff --git a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs index cf7e54aa..d1def91b 100644 --- a/src/SMAPI/Framework/Events/ModGameLoopEvents.cs +++ b/src/SMAPI/Framework/Events/ModGameLoopEvents.cs @@ -72,6 +72,13 @@ namespace StardewModdingAPI.Framework.Events remove => this.EventManager.DayStarted.Remove(value); } + /// <summary>Raised before the game ends the current day. This happens before it starts setting up the next day and before <see cref="IGameLoopEvents.Saving"/>.</summary> + public event EventHandler<DayEndingEventArgs> DayEnding + { + add => this.EventManager.DayEnding.Add(value); + remove => this.EventManager.DayEnding.Remove(value); + } + /********* ** Public methods |