//=============================================================================
// RPG Maker MZ - AddLoad
//=============================================================================
/*:
* @target MZ
* @plugindesc AddLoad
* @author Errke
*
*
* @param LoadName
* @text Command Name
* @desc The Name of the Load Command
* @type string
*
* @help AddLoad.js
* Add a command in menu scene.
*
*
*/
(() => {
const pluginName = 'AddLoad';
const parameters = PluginManager.parameters(pluginName);
const LoadName = parameters['LoadName'] || 'load game';
const _window_menucommand_pro = Window_MenuCommand.prototype.makeCommandList;
Window_MenuCommand.prototype.makeCommandList = function() {
_window_menucommand_pro.apply(this,arguments);
this.addLoadCommand();
};
Window_MenuCommand.prototype.addLoadCommand = function() {
this.addCommand(LoadName, "load", true);
};
//const _scene_menu_pro = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function() {
const rect = this.commandWindowRect();
const commandWindow = new Window_MenuCommand(rect);
commandWindow.setHandler("item", this.commandItem.bind(this));
commandWindow.setHandler("skill", this.commandPersonal.bind(this));
commandWindow.setHandler("equip", this.commandPersonal.bind(this));
commandWindow.setHandler("status", this.commandPersonal.bind(this));
commandWindow.setHandler("formation", this.commandFormation.bind(this));
commandWindow.setHandler("options", this.commandOptions.bind(this));
commandWindow.setHandler("save", this.commandSave.bind(this));
commandWindow.setHandler("load", this.commandLoad.bind(this));
commandWindow.setHandler("gameEnd", this.commandGameEnd.bind(this));
commandWindow.setHandler("cancel", this.popScene.bind(this));
this.addWindow(commandWindow);
this._commandWindow = commandWindow;
};
Scene_Menu.prototype.commandLoad = function() {
SceneManager.push(Scene_Load);
};
})();