//制作命令列表 Window_TitleCommand.prototype.makeCommandList = function() { //添加一个选项 ,前面是显示内容, 后面是标志,用于方法调用时使用 this.addCommand(TextManager.newGame, 'newGame'); this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled()); this.addCommand(TextManager.options, 'options'); //如果要添添加一个项目可以直接添加文字 this.addCommand("第四个", 'four'); }; (function() { //制作命令列表 Window_TitleCommand.prototype.makeCommandList = function() { this.addCommand("新游戏", 'newGame'); this.addCommand("继续", 'continue', this.isContinueEnabled()); this.addCommand("设置", 'options'); this.addCommand("退出", 'four'); }; //创造选择窗口 Scene_Title.prototype.createCommandWindow = function() { this._commandWindow = new Window_TitleCommand(); //标志 绑定方法 也就是当点击相应选项时,会使用该选项标志 对应的方法 this._commandWindow.setHandler('newGame', this.commandNewGame.bind(this)); this._commandWindow.setHandler('continue', this.commandContinue.bind(this)); this._commandWindow.setHandler('options', this.commandOptions.bind(this)); //添加一个 this._commandWindow.setHandler('four', this.commandFour.bind(this)); this.addWindow(this._commandWindow); }; Scene_Title.prototype.commandFour = function() { SceneManager.exit() }; })();
//----------------------------------------------------------------------------- // PluginManager // 插件管理器 // The static class that manages the plugins. // 这个静态的类 管理 插件 function PluginManager() { throw new Error('This is a static class'); } //路径 PluginManager._path = 'js/plugins/'; //脚本 PluginManager._scripts = []; //错误地址 PluginManager._errorUrls = []; //参数 PluginManager._parameters = {}; //安装 PluginManager.setup = function(plugins) { plugins.forEach(function(plugin) { if (plugin.status && !this._scripts.contains(plugin.name)) { this.setParameters(plugin.name, plugin.parameters); this.loadScript(plugin.name + '.js'); this._scripts.push(plugin.name); } }, this); }; //检查错误 PluginManager.checkErrors = function() { var url = this._errorUrls.shift(); if (url) { throw new Error('Failed to load: ' + url); } }; //参数 PluginManager.parameters = function(name) { return this._parameters[name.toLowerCase()] || {}; }; //设置参数 PluginManager.setParameters = function(name, parameters) { this._parameters[name.toLowerCase()] = parameters; }; //读取脚本 PluginManager.loadScript = function(name) { var url = this._path + name; var script = document.createElement('script'); script.type = 'text/javascript'; script.src = url; script.async = false; script.onerror = this.onError.bind(this); script._url = url; document.body.appendChild(script); }; //在错误 PluginManager.onError = function(e) { this._errorUrls.push(e.target._url); };
汪汪 发表于 2015-12-21 13:22
//-----------------------------------------------------------------------------
// PluginManager
// ...
汪汪 发表于 2015-12-21 13:22
//-----------------------------------------------------------------------------
// PluginManager
// ...
dsd.jpg (138.31 KB, 下载次数: 13)
518 Bytes, 下载次数: 52
汪汪 发表于 2015-12-21 12:34
不推荐直接改脚本.
而且直接改脚本,1,2,3步改成一步就好
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |