Call to check if player is in menu

Hello!

Is there a way to script check in a conditional branch whether the player is in menu?

I know that you can check if player is in battle with:

Code:
$gameParty.inBattle()

Is there something similar but to check if the player is using the menu?

Context: I have an item that calls a Common Event, and I need it to behave differently in map, in battle, and when used from the item menu outside of battle.
HTML:
SceneManager._scene === Scene_Item
I don't know much about Js but I think this should work.

Edit: I think when player uses an Item in Item Menu, the scene will change to Scene_Map then execute the common event.
So to check previous scene is Scene_Item, you can use this script call:
HTML:
SceneManager.isPreviousScene(Scene_Item)
That should work, yeah.
HTML:
SceneManager._scene === Scene_Item
I don't know much about Js but I think this should work.

Edit: I think when player uses an Item in Item Menu, the scene will change to Scene_Map then execute the common event.
So to check previous scene is Scene_Item, you can use this script call:
HTML:
SceneManager.isPreviousScene(Scene_Item)

This did the job.

Thanks a lot! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/call-to-check-if-player-is-in-menu.75935/