/*:
* @plugindesc 调试1
* @author: lh
*
* @param ggsj
* @text 公共事件ID
* @desc 公共事件ID
* 默认值:1
* @default 1
*
* @param anmz
* @text 按钮名字
* @desc 按钮名字
* 默认值:1
* @default 1
*
* @param anbq
* @text 按钮标签
* @desc 按钮标签
* 默认值:1
* @default 1
*/
var params = PluginManager.parameters("TS_1");
var ggsj = Number(params["ggsj"]) || 1;
var anmz = (params["anmz"]) || 1;
var anbq = (params["anbq"]) || 1;
var _Scene_Menu_NewButton = Window_MenuCommand.prototype.addOriginalCommands;
Window_MenuCommand.prototype.addOriginalCommands = function() {
_Scene_Menu_NewButton.call(this);
this.addCommand(anmz, anbq, true); // 添加一个新的菜单按钮
};
var _Scene_Menu_createCommandWindow = Scene_Menu.prototype.createCommandWindow;
Scene_Menu.prototype.createCommandWindow = function () {
_Scene_Menu_createCommandWindow.call(this);
this._commandWindow.setHandler(anbq, this.commandYourNewButton.bind(this)); // 添加按钮的事件处理程序
};
Scene_Menu.prototype.commandYourNewButton = function() {
SceneManager.pop();
$gameTemp.reserveCommonEvent(ggsj); // 关闭菜单并执行公共事件
};