How do I pop a common event menu back to main menu?

Hello;

I am using yanfly's common event menu. It runs fine off the main menu using main menu core from yanfly. If I hit the escape key I want it to go back to the main menu like any other main menu selection. But when I hit escape it goes to the map. I think I have to pop back or something similar to scene push? How is this done?

thanks for your time
yours
Winkr7

I've moved this thread to Plugin Support. Thank you.

Find this part of YEP_CommonEventMenu.js
it's the part that handles what happens on cancel
Code:
Scene_Base.prototype.onCommonEventMenuCancel = function() {
    this.closeCommonEventMenuWindows();
    var id = $gameSystem.getCommonEventMenuCancel();
    this.commonEventMenuSetupList(id);
};
And add this scene push as the last thing before the };
Code:
SceneManager.push(Scene_Menu);
And that should look like
Code:
Scene_Base.prototype.onCommonEventMenuCancel = function() {
    this.closeCommonEventMenuWindows();
    var id = $gameSystem.getCommonEventMenuCancel();
    this.commonEventMenuSetupList(id);
    SceneManager.push(Scene_Menu);
};
Did it work? :LZSproud:
Thankyou ozubon;

I appreciate the help but didn't want to change the js code directly. If I set up a common event with
just the call SceneManager.push(Scene_Menu) and then reference that event with the plugin
SetCommonEventMenuCancel #ofevent
it work.

This always makes cancel return me to the main menu and I can hotkey the menu too. In that case I want to go to the map scene. I can't tell how I got there so I really want to do some kind of pop back to whereever I was. I think I need something like SceneManager.pop().

Anyway, your suggestion got me to thinking and I appreciate your help.

yours
Winkr7
What about just directly open menu scene from the common event itself?
What about just directly open menu scene from the common event itself?
This is possible, but there's a small frame where you will see the common event close and the menu open again. It works, but it looks sloppy.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-pop-a-common-event-menu-back-to-main-menu.104040/