diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-08-31 20:43:03 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-08-31 20:43:03 -0400 |
commit | 685d56894f837fd9739a7dc021adc9b13d56be00 (patch) | |
tree | 27bd3cf6601df59fc6236cc170baac0232903903 /src/SMAPI/Framework/SCore.cs | |
parent | 828be405e11dd8bc7f8a3692d2c74517734f67a5 (diff) | |
download | SMAPI-685d56894f837fd9739a7dc021adc9b13d56be00.tar.gz SMAPI-685d56894f837fd9739a7dc021adc9b13d56be00.tar.bz2 SMAPI-685d56894f837fd9739a7dc021adc9b13d56be00.zip |
switch SGame back to callbacks
Callbacks are simpler and more efficient in this case.
Diffstat (limited to 'src/SMAPI/Framework/SCore.cs')
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 3645fb9c..eedbfc64 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -258,15 +258,14 @@ namespace StardewModdingAPI.Framework eventManager: this.EventManager, modHooks: modHooks, multiplayer: multiplayer, - exitGameImmediately: this.ExitGameImmediately + exitGameImmediately: this.ExitGameImmediately, + + onGameContentLoaded: this.OnGameContentLoaded, + onGameUpdating: this.OnGameUpdating, + onGameExiting: this.OnGameExiting ); StardewValley.Program.gamePtr = this.Game; - // hook game events - this.Game.OnGameContentLoaded += this.OnLoadContent; - this.Game.OnGameUpdating += this.OnGameUpdating; - this.Game.OnGameExiting += this.OnGameExiting; - // apply game patches new GamePatcher(this.Monitor).Apply( new EventErrorPatch(this.LogManager.MonitorForGame), @@ -445,7 +444,7 @@ namespace StardewModdingAPI.Framework } /// <summary>Raised after the game finishes loading its initial content.</summary> - private void OnLoadContent() + private void OnGameContentLoaded() { // override map display device Game1.mapDisplayDevice = new SDisplayDevice(Game1.content, Game1.game1.GraphicsDevice); |