MV How to add "options" to the battle scene.

How do I add an "options" option to the battle scene, whether by plugin or by editing the scripts?
I want to when the player presses "escape" to show the

Fight
Escape
"Options"

They would be able to pick options if they wanted to change audio volume or command-remember during a battle.
Had the thought of how convenient it would be during a test, and it is kind of annoying when I get into a battle and want to adjust settings but can only do so before or after a battle, not during one. Other RPG's (non-rpg maker) allow players to change settings mid-combat, and I don't see a reason it won't work for mine since I don't have any crazy options (yet) just the vanilla.
Have you tried NinJapon's CommonEventPartyCommands.js?

https://forums.rpgmakerweb.com/index.php?threads/common-event-party-commands.129542/#post-1149949
Have you tried NinJapon's CommonEventPartyCommands.js?
Note, from the first post in that thread:

Opening other scenes while in battle...will cause problems like removing states and buffs from actors and other stuff...

As best I can think, you'd need to add code to the battle scene that adds an option window as a child, then has commands to activate it for navigation and return to actor input afterward.
Yea, this is more complicated than it seems. Normally the options are a separate scene, which would cause problems because the core scripts don't support mid-battle scene changes.

[Edit: like Turan says...] You may need a plugin that specifically adds an options window to the battle scene, and handles related battle flow etc appropriately. Perhaps something like this:
Spoiler: plugin code
JavaScript:
/*:
 * @target MV
 * @plugindesc Add "options" party battle command.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/165820/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (() => {
"use strict";

  const KEY = "_optionsWindow";

  const showOptions = function() {
    this[KEY].open();
    this[KEY].activate();
  };

  const resumeBattle = function() {
    ConfigManager.save();
    this[KEY].deactivate();
    this[KEY].close();
    this._partyCommandWindow.activate();
  };

  void (alias => {
    Scene_Battle.prototype.createAllWindows = function() {
      alias.apply(this, arguments);
      const w = this[KEY] = new Window_Options();
      w.setHandler("cancel", resumeBattle.bind(this));
      w.openness = 0;
      w.deactivate();
      this.addWindow(w);
    };
  })(Scene_Battle.prototype.createAllWindows);

  void (alias => {
    Scene_Battle.prototype.createPartyCommandWindow = function() {
      alias.apply(this, arguments);
      this._partyCommandWindow.setHandler("options", showOptions.bind(this));
    };
  })(Scene_Battle.prototype.createPartyCommandWindow);

  void (alias => {
    Scene_Battle.prototype.isAnyInputWindowActive = function() {
      return alias.apply(this, arguments) || this[KEY].active;
    };
  })(Scene_Battle.prototype.isAnyInputWindowActive);

  void (alias => {
    Window_PartyCommand.prototype.makeCommandList = function() {
      alias.apply(this, arguments);
      this.addCommand(TextManager.options, "options");
    };
  })(Window_PartyCommand.prototype.makeCommandList);

})();
Yea, this is more complicated than it seems. Normally the options are a separate scene, which would cause problems because the core scripts don't support mid-battle scene changes.

[Edit: like Turan says...] You may need a plugin that specifically adds an options window to the battle scene, and handles related battle flow etc appropriately. Perhaps something like this:
Spoiler: plugin code
JavaScript:
/*:
 * @target MV
 * @plugindesc Add "options" party battle command.
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/165820/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (() => {
"use strict";

  const KEY = "_optionsWindow";

  const showOptions = function() {
    this[KEY].open();
    this[KEY].activate();
  };

  const resumeBattle = function() {
    ConfigManager.save();
    this[KEY].deactivate();
    this[KEY].close();
    this._partyCommandWindow.activate();
  };

  void (alias => {
    Scene_Battle.prototype.createAllWindows = function() {
      alias.apply(this, arguments);
      const w = this[KEY] = new Window_Options();
      w.setHandler("cancel", resumeBattle.bind(this));
      w.openness = 0;
      w.deactivate();
      this.addWindow(w);
    };
  })(Scene_Battle.prototype.createAllWindows);

  void (alias => {
    Scene_Battle.prototype.createPartyCommandWindow = function() {
      alias.apply(this, arguments);
      this._partyCommandWindow.setHandler("options", showOptions.bind(this));
    };
  })(Scene_Battle.prototype.createPartyCommandWindow);

  void (alias => {
    Scene_Battle.prototype.isAnyInputWindowActive = function() {
      return alias.apply(this, arguments) || this[KEY].active;
    };
  })(Scene_Battle.prototype.isAnyInputWindowActive);

  void (alias => {
    Window_PartyCommand.prototype.makeCommandList = function() {
      alias.apply(this, arguments);
      this.addCommand(TextManager.options, "options");
    };
  })(Window_PartyCommand.prototype.makeCommandList);

})();
Oh, thank you very much!
It works quite well. No problems found yet; I'll stress test it later. lol

Edit: Only some very minor visual bugs when options menu opens but fixes itself when options are closed.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

E.g. if you run into issues with it in future. 👋

Original thread: https://forums.rpgmakerweb.com/threads/how-to-add-options-to-the-battle-scene.165820/