summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Inheritance
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI/Inheritance')
-rw-r--r--src/StardewModdingAPI/Inheritance/SGame.cs12
-rw-r--r--src/StardewModdingAPI/Inheritance/SObject.cs2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/StardewModdingAPI/Inheritance/SGame.cs b/src/StardewModdingAPI/Inheritance/SGame.cs
index f70d0696..16803a73 100644
--- a/src/StardewModdingAPI/Inheritance/SGame.cs
+++ b/src/StardewModdingAPI/Inheritance/SGame.cs
@@ -913,11 +913,17 @@ namespace StardewModdingAPI.Inheritance
// raise menu changed
if (Game1.activeClickableMenu != this.PreviousActiveMenu)
{
+ // raise events
+ IClickableMenu previousMenu = this.PreviousActiveMenu;
+ IClickableMenu newMenu = Game1.activeClickableMenu;
if (Game1.activeClickableMenu != null)
- MenuEvents.InvokeMenuChanged(this.Monitor, this.PreviousActiveMenu, Game1.activeClickableMenu);
+ MenuEvents.InvokeMenuChanged(this.Monitor, previousMenu, newMenu);
else
- MenuEvents.InvokeMenuClosed(this.Monitor, this.PreviousActiveMenu);
- this.PreviousActiveMenu = Game1.activeClickableMenu;
+ MenuEvents.InvokeMenuClosed(this.Monitor, previousMenu);
+
+ // update previous menu
+ // (if the menu was changed in one of the handlers, deliberately defer detection until the next update so mods can be notified of the new menu change)
+ this.PreviousActiveMenu = newMenu;
}
// raise location list changed
diff --git a/src/StardewModdingAPI/Inheritance/SObject.cs b/src/StardewModdingAPI/Inheritance/SObject.cs
index 4a218f33..eae5424d 100644
--- a/src/StardewModdingAPI/Inheritance/SObject.cs
+++ b/src/StardewModdingAPI/Inheritance/SObject.cs
@@ -49,7 +49,7 @@ namespace StardewModdingAPI.Inheritance
*********/
public SObject()
{
- Program.DeprecationManager.Warn(nameof(SObject), "0.39.3", DeprecationLevel.Notice);
+ Program.DeprecationManager.Warn(nameof(SObject), "0.39.3", DeprecationLevel.Info);
this.name = "Modded Item Name";
this.Description = "Modded Item Description";