diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-11 22:32:33 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-11 22:32:33 -0400 |
commit | 5a7422b3122dc0c46c6fe9b445eae0bc5df77298 (patch) | |
tree | 502748abf8960c6bf06fbec2837243c51c3725b6 | |
parent | bbe5983acdd082d2185a69e2ad37d659a298223d (diff) | |
download | SMAPI-5a7422b3122dc0c46c6fe9b445eae0bc5df77298.tar.gz SMAPI-5a7422b3122dc0c46c6fe9b445eae0bc5df77298.tar.bz2 SMAPI-5a7422b3122dc0c46c6fe9b445eae0bc5df77298.zip |
log time change in verbose mode
-rw-r--r-- | docs/release-notes.md | 1 | ||||
-rw-r--r-- | src/SMAPI/Framework/SCore.cs | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md index b35a4760..53711454 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,7 @@ * For mod authors: * Refactored how event handling works under the hood, particularly the new content API. This should have no effect on mod usage. + * In-game time changes are now logged in verbose mod. * Fixed error when loading a `.xnb` file through the old content API without the file extension. * Fixed asset propagation for player sprites not fully updating recolor masks in some cases. diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs index 41b975e8..5ae4fdbb 100644 --- a/src/SMAPI/Framework/SCore.cs +++ b/src/SMAPI/Framework/SCore.cs @@ -960,8 +960,14 @@ namespace StardewModdingAPI.Framework } // raise time changed - if (raiseWorldEvents && state.Time.IsChanged && events.TimeChanged.HasListeners) - events.TimeChanged.Raise(new TimeChangedEventArgs(state.Time.Old, state.Time.New)); + if (raiseWorldEvents && state.Time.IsChanged) + { + if (verbose) + this.Monitor.Log($"Context: time changed to {state.Time.New}."); + + if (events.TimeChanged.HasListeners) + events.TimeChanged.Raise(new TimeChangedEventArgs(state.Time.Old, state.Time.New)); + } // raise player events if (raiseWorldEvents) |