Fix bug of MenuChanged Event

This commit is contained in:
yangzhi 2020-02-13 15:29:50 +08:00 committed by Chris
parent 528c7459d0
commit 2cd19042c9
1 changed files with 2 additions and 2 deletions

View File

@ -692,8 +692,8 @@ namespace StardewModdingAPI.Framework
*********/ *********/
if (state.ActiveMenu.IsChanged) if (state.ActiveMenu.IsChanged)
{ {
IClickableMenu was = this.Watchers.ActiveMenuWatcher.PreviousValue; IClickableMenu was = state.ActiveMenu.Old;
IClickableMenu now = this.Watchers.ActiveMenuWatcher.CurrentValue; IClickableMenu now = state.ActiveMenu.New;
if (this.Monitor.IsVerbose) if (this.Monitor.IsVerbose)
this.Monitor.Log($"Context: menu changed from {state.ActiveMenu.Old?.GetType().FullName ?? "none"} to {state.ActiveMenu.New?.GetType().FullName ?? "none"}.", LogLevel.Trace); this.Monitor.Log($"Context: menu changed from {state.ActiveMenu.Old?.GetType().FullName ?? "none"} to {state.ActiveMenu.New?.GetType().FullName ?? "none"}.", LogLevel.Trace);