summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/SCore.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-08-31 20:43:03 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-08-31 20:43:03 -0400
commit685d56894f837fd9739a7dc021adc9b13d56be00 (patch)
tree27bd3cf6601df59fc6236cc170baac0232903903 /src/SMAPI/Framework/SCore.cs
parent828be405e11dd8bc7f8a3692d2c74517734f67a5 (diff)
downloadSMAPI-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.cs13
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);