Custom Menu opens while closing scenes

I made a custom menu that opens with the 'escape' key (esc, x, etc...)
The problem is that when I want to close a dialogue or a different scene, it opens automatically. How should I fix this?
Either assign it a different button or do something like put an additional conditional check to only trigger if no windows are open
Either assign it a different button or do something like put an additional conditional check to only trigger if no windows are owhat
What's the script for that conditional?
The only script I have on hand is
($gameMessage.isBusy())
Which checks if a text window is open
I'd try something like this (in the script box of a conditional branch:
JavaScript:
!$gameMessage.isBusy() && SceneManager._scene instanceof Scene_Map

That will make it so that any commands inside the conditional branch will only be executed if the player is on the map scene, and they don't have dialogue, a number input, a choice, or an item choice currently running.
I'd try something like this (in the script box of a conditional branch:
JavaScript:
!$gameMessage.isBusy() && SceneManager._scene instanceof Scene_Map

That will make it so that any commands inside the conditional branch will only be executed if the player is on the map scene, and they don't have dialogue, a number input, a choice, or an item choice currently running.
thank you!!! I'll try it out tomorrow
thank you!!! I'll try it out tomorrow
No problem. But now that I think about it, you will probably still have an issue if you use the escape button to exit another scene, since it's likely that you will still have the escape button pressed for a few frames by the time that the map scene comes back up.

If so, I'd recommend changing the If: Button [Cancel] is pressed down condition to this (put it inside the condition's script box):
JavaScript:
Input.isTriggered("escape")

Actually, if you're doing that, you can just combine everything into one condition. So just edit the If: Button [Cancel] is pressed down conditional branch that you already have, tick the 'Script' box, and paste this in there:
JavaScript:
Input.isTriggered("escape") && !$gameMessage.isBusy() && SceneManager._scene instanceof Scene_Map
No problem. But now that I think about it, you will probably still have an issue if you use the escape button to exit another scene, since it's likely that you will still have the escape button pressed for a few frames by the time that the map scene comes back up.

If so, I'd recommend changing the If: Button [Cancel] is pressed down condition to this (put it inside the condition's script box):
JavaScript:
Input.isTriggered("escape")

Actually, if you're doing that, you can just combine everything into one condition. So just edit the If: Button [Cancel] is pressed down conditional branch that you already have, tick the 'Script' box, and paste this in there:
JavaScript:
Input.isTriggered("escape") && !$gameMessage.isBusy() && SceneManager._scene instanceof Scene_Map
Alright! I'll let you know if it works properly when I test it

No problem. But now that I think about it, you will probably still have an issue if you use the escape button to exit another scene, since it's likely that you will still have the escape button pressed for a few frames by the time that the map scene comes back up.

If so, I'd recommend changing the If: Button [Cancel] is pressed down condition to this (put it inside the condition's script box):
JavaScript:
Input.isTriggered("escape")

Actually, if you're doing that, you can just combine everything into one condition. So just edit the If: Button [Cancel] is pressed down conditional branch that you already have, tick the 'Script' box, and paste this in there:
JavaScript:
Input.isTriggered("escape") && !$gameMessage.isBusy() && SceneManager._scene instanceof Scene_Map
It works perfectly, thank you!
Actually, if you're doing that, you can just combine everything into one condition. So just edit the If: Button [Cancel] is pressed down conditional branch that you already have, tick the 'Script' box, and paste this in there:
JavaScript:
Input.isTriggered("escape") && !$gameMessage.isBusy() && SceneManager._scene instanceof Scene_Map
Just got the idea to change my dash button to this instead of the shift button to free up shift for something else.

Original thread: https://forums.rpgmakerweb.com/threads/custom-menu-opens-while-closing-scenes.158724/