How to change options menu box size?

Hi everyone,
Lately I've decided to remove the 'Always Dash' option from the menu of my game.
I manage to do it with this simple code:
Code:
Window_Options.prototype.addGeneralOptions = function() {
//  this.addCommand(TextManager.alwaysDash, 'alwaysDash');  //
};

I have a problem though, ever since I've removed it, there is an annoying empty space on the bottom of the options, here is an image of the options box, you can see the dead space on the bottom:
Screenshot 2024-06-24 at 15.48.56.png


Any way to change the options box height?
It's because MV resizes the window after generating its command list, but MZ determines the window size beforehand. So you also need to patch the appropriate method of the scene.

I'd suggest:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Remove "Always Dash" in-game option.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/169748/
 * @help Free to use and/or modify for any project, no credit required.
 */
void (() => {
'use strict';

  /* Symbols of options to hide/remove. */
  const REMOVE = ["alwaysDash"];

  // Patch - don't add removed options.
  const addCommand = Window_Options.prototype.addCommand;
  Window_Options.prototype.addCommand = function(name, symbol, enabled, ext) {
    if (!REMOVE.includes(symbol))
      addCommand.apply(this, arguments);
  };

  // Patch - reduce number of options commands accordingly.
  const maxCommands = Scene_Options.prototype.maxCommands;
  Scene_Options.prototype.maxCommands = function() {
    return maxCommands.apply(this, arguments) - REMOVE.length;
  };

})();
It's because MV resizes the window after generating its command list, but MZ determines the window size beforehand. So you also need to patch the appropriate method of the scene.

I'd suggest:
Spoiler: plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Remove "Always Dash" in-game option.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/169748/
 * @help Free to use and/or modify for any project, no credit required.
 */
void (() => {
'use strict';

  /* Symbols of options to hide/remove. */
  const REMOVE = ["alwaysDash"];

  // Patch - don't add removed options.
  const addCommand = Window_Options.prototype.addCommand;
  Window_Options.prototype.addCommand = function(name, symbol, enabled, ext) {
    if (!REMOVE.includes(symbol))
      addCommand.apply(this, arguments);
  };

  // Patch - reduce number of options commands accordingly.
  const maxCommands = Scene_Options.prototype.maxCommands;
  Scene_Options.prototype.maxCommands = function() {
    return maxCommands.apply(this, arguments) - REMOVE.length;
  };

})();
Worked like a charm 🙂

THANK YOU!
Hello! Just asking as a bit of a beginner to RMMZ and plugins but if I'm trying to do something similar and remove the Touch UI and Command Remember options, would I just type those options in the place of the Always Dash option? I would like to keep the Always Dash option available but just remove the other two as I don't plan on implementing either of those features in my project. Thank you for this awesome plugin as well! It works wonderfully! 🙂
Hello! Just asking as a bit of a beginner to RMMZ and plugins but if I'm trying to do something similar and remove the Touch UI and Command Remember options, would I just type those options in the place of the Always Dash option? I would like to keep the Always Dash option available but just remove the other two as I don't plan on implementing either of those features in my project. Thank you for this awesome plugin as well! It works wonderfully! 🙂

You can try this plugin.
That's what I used to remove the Touch UI and Command Remember.
(^ Here's a link to the unedited plugin by Theo. It only uses overrides so I would suggest putting it near the top of your plugin load order.)

Alternatively, yes - @BradyFoxArt you can just change this line of my plugin:
JavaScript:
  const REMOVE = ["alwaysDash"];
...to something like:
JavaScript:
  const REMOVE = ["alwaysDash", "commandRemember", "touchUI"];
Touch UI is a more important accessibility option than the other two, so you might want to reconsider disabling it entirely, especially if you plan to deploy to web. It's your game, though! 👋
(^ Here's a link to the unedited plugin by Theo. It only uses overrides so I would suggest putting it near the top of your plugin load order.)

Alternatively, yes - @BradyFoxArt you can just change this line of my plugin:
JavaScript:
  const REMOVE = ["alwaysDash"];
...to something like:
JavaScript:
  const REMOVE = ["alwaysDash", "commandRemember", "touchUI"];
Touch UI is a more important accessibility option than the other two, so you might want to reconsider disabling it entirely, especially if you plan to deploy to web. It's your game, though! 👋
You can try this plugin.
That's what I used to remove the Touch UI and Command Remember.
Perfect!! Thank you both very much!! I'll definitely play around with both and see how they work!! 😀

I never thought of that before tho with touch UI and making a web port! I'll definitely reconsider that for sure!! That's a very smart and definitely important to have!! 🙂

Thank you both very much again!! I greatly appreciate it!! 😀

Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-options-menu-box-size.169748/