summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI')
-rw-r--r--src/StardewModdingAPI/Inheritance/SGame.cs18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/StardewModdingAPI/Inheritance/SGame.cs b/src/StardewModdingAPI/Inheritance/SGame.cs
index 8f751bc7..92109f8b 100644
--- a/src/StardewModdingAPI/Inheritance/SGame.cs
+++ b/src/StardewModdingAPI/Inheritance/SGame.cs
@@ -104,9 +104,6 @@ namespace StardewModdingAPI.Inheritance
/// <summary>The active game menu at last check.</summary>
public IClickableMenu PreviousActiveMenu { get; private set; }
- /// <summary>Whether the <see cref="MenuEvents.MenuClosed"/> event was raised in the last tick.</summary>
- internal bool WasMenuClosedInvoked;
-
/// <summary>The mine level at last check.</summary>
public int PreviousMineLevel { get; private set; }
@@ -936,18 +933,13 @@ namespace StardewModdingAPI.Inheritance
}
// raise menu changed
- if (Game1.activeClickableMenu != null && Game1.activeClickableMenu != this.PreviousActiveMenu)
+ if (Game1.activeClickableMenu != this.PreviousActiveMenu)
{
- MenuEvents.InvokeMenuChanged(this.PreviousActiveMenu, Game1.activeClickableMenu);
+ if (Game1.activeClickableMenu != null)
+ MenuEvents.InvokeMenuChanged(this.PreviousActiveMenu, Game1.activeClickableMenu);
+ else
+ MenuEvents.InvokeMenuClosed(this.PreviousActiveMenu);
this.PreviousActiveMenu = Game1.activeClickableMenu;
- this.WasMenuClosedInvoked = false;
- }
-
- // raise menu closed
- if (!this.WasMenuClosedInvoked && this.PreviousActiveMenu != null && Game1.activeClickableMenu == null)
- {
- MenuEvents.InvokeMenuClosed(this.PreviousActiveMenu);
- this.WasMenuClosedInvoked = true;
}
// raise location list changed