SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

SMAPI doesn't detect menu changes inside menu event handlers

Pathoschild opened this issue · 1 comments

commented

When SMAPI detects a menu change, it notifies all mods and then sets PreviousMenu to the current active menu. If a mod changes the menu again in a menu event handler, SMAPI doesn't notice the change and doesn't raise a new event. This can lead to scenarios like this:

what happened event raised
Menu A opened. MenuChangedEvent
Menu B opened. MenuChangedEvent
Menu B closed. MenuClosedEvent
Menu A opened
(inside a MenuClosedEvent handler).
✘ no event raised

That scenario occurs frequently with some mods. For example:

  1. View a chest with Chests Anywhere.
  2. Lookup any item with Lookup Anything.
  3. Close the lookup UI.
  4. The chest UI is reopened, but the Chests Anywhere is not re-added (since the mod wasn't notified).
commented

Fixed in the develop branch for the upcoming 1.5 release.