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

Discussion in 'Javascript/Plugin Support' started by winkr7, Jan 5, 2019.

    Tags:
  1. winkr7

    winkr7 Veteran Veteran

    Messages:
    54
    Likes Received:
    9
    First Language:
    english
    Primarily Uses:
    N/A
    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
     
    #1
  2. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,333
    Likes Received:
    7,375
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV

    I've moved this thread to Plugin Support. Please be sure to post your threads in the correct forum next time. Thank you.

     
    #2
  3. ozubon

    ozubon Villager Member

    Messages:
    21
    Likes Received:
    10
    First Language:
    English
    Primarily Uses:
    RMMV
    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:
     
    #3
    Wavelength likes this.
  4. winkr7

    winkr7 Veteran Veteran

    Messages:
    54
    Likes Received:
    9
    First Language:
    english
    Primarily Uses:
    N/A
    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
     
    #4
  5. Kuro DCupu

    Kuro DCupu Responsible for Kitten Mita development Veteran

    Messages:
    221
    Likes Received:
    854
    Location:
    Indonesia
    First Language:
    Indonesian
    Primarily Uses:
    RMMV
    What about just directly open menu scene from the common event itself?
     
    #5
  6. Fernyfer775

    Fernyfer775 Veteran Veteran

    Messages:
    1,287
    Likes Received:
    771
    First Language:
    English
    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.
     
    #6

Share This Page