summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/SGame.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-10-06 00:51:45 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-10-06 00:51:45 -0400
commit79705448f57c962e9331fb802097c24d2424476c (patch)
tree06b15229f7f9089af864fa0f948f209bc5aec51a /src/SMAPI/Framework/SGame.cs
parent14fab29370310a762a000c50b23075326b4e95da (diff)
downloadSMAPI-79705448f57c962e9331fb802097c24d2424476c.tar.gz
SMAPI-79705448f57c962e9331fb802097c24d2424476c.tar.bz2
SMAPI-79705448f57c962e9331fb802097c24d2424476c.zip
add DayEnding event (#310)
Diffstat (limited to 'src/SMAPI/Framework/SGame.cs')
-rw-r--r--src/SMAPI/Framework/SGame.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index ef851afc..bd266ce1 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -151,6 +151,7 @@ namespace StardewModdingAPI.Framework
this.OnGameExiting = onGameExiting;
Game1.input = new SInputState();
Game1.multiplayer = new SMultiplayer(monitor, eventManager);
+ Game1.hooks = new SModHooks(this.OnNewDayAfterFade);
// init observables
Game1.locations = new ObservableCollection<GameLocation>();
@@ -182,6 +183,12 @@ namespace StardewModdingAPI.Framework
/****
** Intercepted methods & events
****/
+ /// <summary>A callback invoked before <see cref="Game1.newDayAfterFade"/> runs.</summary>
+ protected void OnNewDayAfterFade()
+ {
+ this.Events.DayEnding.RaiseEmpty();
+ }
+
/// <summary>Constructor a content manager to read XNB files.</summary>
/// <param name="serviceProvider">The service provider to use to locate services.</param>
/// <param name="rootDirectory">The root directory to search for content.</param>