TitleShutdownCommand plugin
Version : 1.00
Introduction
This plugins adds a Shutdown command to the Title screen, for people who miss that functionality, and do not want to exit by ALT+F4 the game.
[url=http://www.servimg.com/view/11151036/485][/url]
How to Use
Put the following code in a JS file named
TitleShutdownCommand.js , that you insert in the plugin folder. Then, be sure to add the plugin to the project using the ProjectManager. You can then specify the name displayed on the command window. By default, Shutdown is set as text.
Script
Spoiler Code:
//============================================================================= // This plugin adds a shutdown command to the main menu //============================================================================= /*: * @plugindesc Adds a Shutdown command to the Title screen * @author Schlangan * * @param Name * @desc The name displayed for the Shutdown command * @default Shutdown * @help No plugin command associated. */ Window_TitleCommand.prototype.makeCommandList = function() { var parameters = PluginManager.parameters('TitleShutdownCommand'); var shutdown_name = parameters['Name'] || "Shutdown"; this.addCommand(TextManager.newGame, 'newGame'); this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled()); this.addCommand(TextManager.options, 'options'); this.addCommand(shutdown_name, 'shutdown'); }; 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('shutdown', this.commandShutdown.bind(this)); this.addWindow(this._commandWindow); }; Scene_Title.prototype.commandShutdown = function() { this._commandWindow.close(); window.close(); }; 复制代码
Credits and Terms of Use
This plugin may be used in any kind of project, commercial or not. Credits are required for commercial projects, optional for non-commercial.
Remarks
I cannot test this plugin on something other than a Windows PC. If for some reason it induces crashes on mobile devices, I'll add a system to make the option only available on non mobile devices.
本贴来自国际rpgmaker官方论坛作者:Schlangan处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/simple-title-shutdown-command.48265/