diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-05-07 01:56:39 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-05-07 01:56:39 -0400 |
commit | 0e304e4d51857e3c7dc9cd18141176e44934755c (patch) | |
tree | 2afce43cf4fffba14bc6190d6107f5d05b5c40bc /src/StardewModdingAPI/Framework | |
parent | c84310dfebafd3085dc418f3620154f9934865de (diff) | |
download | SMAPI-0e304e4d51857e3c7dc9cd18141176e44934755c.tar.gz SMAPI-0e304e4d51857e3c7dc9cd18141176e44934755c.tar.bz2 SMAPI-0e304e4d51857e3c7dc9cd18141176e44934755c.zip |
added basic context logging to simplify troubleshooting
Diffstat (limited to 'src/StardewModdingAPI/Framework')
-rw-r--r-- | src/StardewModdingAPI/Framework/SGame.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Framework/SGame.cs b/src/StardewModdingAPI/Framework/SGame.cs index 1f2bf3ac..dbc257e1 100644 --- a/src/StardewModdingAPI/Framework/SGame.cs +++ b/src/StardewModdingAPI/Framework/SGame.cs @@ -1118,6 +1118,8 @@ namespace StardewModdingAPI.Framework { if (this.AfterLoadTimer == 0) { + this.Monitor.Log($"Context: loaded saved game '{Constants.SaveFolderName}'.", LogLevel.Trace); + SaveEvents.InvokeAfterLoad(this.Monitor); PlayerEvents.InvokeLoadedGame(this.Monitor, new EventArgsLoadedGameChanged(Game1.hasLoadedGame)); TimeEvents.InvokeAfterDayStarted(this.Monitor); @@ -1132,6 +1134,7 @@ namespace StardewModdingAPI.Framework // after exit to title if (this.IsWorldReady && this.IsExiting && Game1.activeClickableMenu is TitleMenu) { + this.Monitor.Log("Context: returned to title", LogLevel.Trace); SaveEvents.InvokeAfterReturnToTitle(this.Monitor); this.AfterLoadTimer = 5; this.IsExiting = false; @@ -1199,9 +1202,13 @@ namespace StardewModdingAPI.Framework // raise save events // (saving is performed by SaveGameMenu; on days when the player shipping something, ShippingMenu wraps SaveGameMenu) if (newMenu is SaveGameMenu || newMenu is ShippingMenu) + { + this.Monitor.Log("Context: before save.", LogLevel.Trace); SaveEvents.InvokeBeforeSave(this.Monitor); + } else if (previousMenu is SaveGameMenu || previousMenu is ShippingMenu) { + this.Monitor.Log("Context: after save, starting new day.", LogLevel.Trace); SaveEvents.InvokeAfterSave(this.Monitor); TimeEvents.InvokeAfterDayStarted(this.Monitor); } |