Close option to click inside the option menu

Discussion in 'JS Plugin Requests' started by ACECORP, May 13, 2016.

  1. ACECORP

    ACECORP Veteran Veteran

    Messages:
    242
    Likes Received:
    29
    When you open the menu shown in the screen shot below, in a town, dungeon, or on the overworld map, it would be nice to have a choice at the bottom below the "Game End" choice that says "close menu" that will simply close the open menu screen so you can return to playing the game. Does anyone have a plugin for RPGMaker MV that does this? Or if nobody does, can someone describe how and what I could do to make such a plugin?


    image.jpeg
     
    Last edited by a moderator: May 13, 2016
    #1
  2. Maliki79

    Maliki79 Veteran Veteran

    Messages:
    516
    Likes Received:
    179
    Location:
    New Jersey
    First Language:
    English
    Is there a reason why just cancelling out is no good?
     
    #2
  3. ACECORP

    ACECORP Veteran Veteran

    Messages:
    242
    Likes Received:
    29
    Yea... I have a d-pad with an a and b game buttons in there and it's not intuitive to the players to not use the d-pad and buttons. So I wanted to add a "close menu" option there so they can just slide the d-pad down to select "close menu" and then press the a button like they do with all the built in menu choices.
     
    Last edited by a moderator: May 13, 2016
    #3
  4. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,221
    Likes Received:
    3,006
    Location:
    Toronto
    First Language:
    English
    This can be done using the menu command manager.





    Here is the code that will create a "Close" command for your menu


    var TH_SceneMenu_closeMenu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
    Scene_Menu.prototype.createCommandWindow = function() {
    TH_SceneMenu_closeMenu_createCommandWindow.call(this);
    this._commandWindow.setHandler('closeMenu', this.commandCloseMenu.bind(this));
    };

    Game_Unit.prototype.addMenuCommand_closeMenu = function() {
    var command = new Data_MenuCommand("closeMenu", "Close");
    this.addMenuCommand(command);
    };

    Window_MenuCommand.prototype.addCommand_closeMenu = function(cmd) {
    this.addCommand(cmd.name, cmd.symbol, cmd.isEnabled(), cmd.ext);
    };

    Scene_Menu.prototype.commandCloseMenu = function() {
    SceneManager.pop();
    };


    You can either create a new plugin file, or add this to the end of menu command manager.


    Then, to add the command to the party, you would use the script call


    $gameParty.addMenuCommand_closeMenu()


    Which will add the command to the end of the party menu.


    This is how it will look




    If you want to change the name of the command, look at the code and look for "Close".


    You can also rename menu commands using script calls provided by the menu command manager.
     
    Last edited by a moderator: May 14, 2016
    #4
    jchedges likes this.
  5. ACECORP

    ACECORP Veteran Veteran

    Messages:
    242
    Likes Received:
    29
    Thanks so much! This solves my issue! I will implement your suggestion! Thanks again!
     
    #5

Share This Page