//============================================================================= // MessageUnlockBusy.js // ---------------------------------------------------------------------------- // Copyright (c) 2015 Triacontane // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // ---------------------------------------------------------------------------- // Version // 1.1.1 2016/08/23 プラグインコマンドが小文字でも機能するよう修正 // 1.1.0 2016/08/23 一度ロックを解除したあとで再度、ロック状態に戻すプラグインコマンドを追加 // 1.0.0 2016/07/20 初版 // ---------------------------------------------------------------------------- // [Blog] : http://triacontane.blogspot.jp/ // [Twitter]: https://twitter.com/triacontane/ // [GitHub] : https://github.com/triacontane/ //============================================================================= /*: @url https://triacontane.blogspot.com/ @plugindesc Unlock Message Plugin @author Triacontane @license MIT License @help English Help Translator: munokura This is an unofficial English translation of the plugin help, created to support global RPG Maker users. Feedback is welcome to improve translation quality (see: https://github.com/munokura/triacontane-MV-plugins ). Original plugin by Triacontane. Please check the latest official version at: https://triacontane.blogspot.com ----- By inserting the control character "\UL" into the message, the message window will remain open while the program moves on to the next event command. You can also execute a plugin command to return the program to a waiting state. Plugin Command Details Execute from the event command "Plugin Command." (Separate parameters with a space.) MUB_RE_WAIT # Return the program to a waiting state. Terms of Use: You may modify and redistribute this plugin without permission from the author, and there are no restrictions on its use (commercial, 18+, etc.). This plugin is now yours. */ /*:ja @plugindesc メッセージのロック解除プラグイン @author トリアコンタン @help メッセージ中に制御文字「\UL」を挿入すると、 メッセージウィンドウを表示したまま次のイベント命令に移行するようになります。 さらにプラグインコマンドを実行することで、再度実行待ち状態に戻すこともできます。 プラグインコマンド詳細 イベントコマンド「プラグインコマンド」から実行。 (パラメータの間は半角スペースで区切る) MUB_再ウェイト # 再度メッセージ待ち状態に戻します。 MUB_RE_WAIT # 同上 利用規約: 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等) についても制限はありません。 このプラグインはもうあなたのものです。 */ (function () { 'use strict'; var metaTagPrefix = 'MUB_'; var setting = { unlockCode: 'UL' }; var getCommandName = function (command) { return (command || '').toUpperCase(); }; //============================================================================= // Game_Message // ウェイト解除処理を追加定義します。 //============================================================================= var _Game_Message_clear = Game_Message.prototype.clear; Game_Message.prototype.clear = function () { _Game_Message_clear.apply(this, arguments); this._interpreter = null; }; Game_Message.prototype.setInterpreter = function (interpreter) { this._interpreter = interpreter; }; Game_Message.prototype.setWaitMode = function (value) { if (this._interpreter) { this._interpreter.setWaitMode(value); } }; //============================================================================= // Game_Interpreter // プラグインコマンドを追加定義します。 //============================================================================= var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand; Game_Interpreter.prototype.pluginCommand = function (command, args) { _Game_Interpreter_pluginCommand.apply(this, arguments); var commandPrefix = new RegExp('^' + metaTagPrefix, 'i'); if (!command.match(commandPrefix)) return; try { this.pluginCommandMessageUnlockBusy(command.replace(commandPrefix, ''), args); } catch (e) { if ($gameTemp.isPlaytest() && Utils.isNwjs()) { var window = require('nw.gui').Window.get(); if (!window.isDevToolsOpen()) { var devTool = window.showDevTools(); devTool.moveTo(0, 0); devTool.resizeTo(window.screenX + window.outerWidth, window.screenY + window.outerHeight); window.focus(); } } console.log('プラグインコマンドの実行中にエラーが発生しました。'); console.log('- コマンド名  : ' + command); console.log('- コマンド引数 : ' + args); console.log('- エラー原因 : ' + e.stack || e.toString()); } }; Game_Interpreter.prototype.pluginCommandMessageUnlockBusy = function (command, args) { switch (getCommandName(command)) { case '再ウェイト': case 'RE_WAIT': if ($gameMessage.isBusy()) this.setWaitMode('message'); break; } }; var _Game_Interpreter_command101 = Game_Interpreter.prototype.command101; Game_Interpreter.prototype.command101 = function () { if (!$gameMessage.isBusy()) { $gameMessage.setInterpreter(this); } _Game_Interpreter_command101.apply(this, arguments); }; //============================================================================= // Window_Message // 制御文字を実装します。 //============================================================================= var _Window_Message_processEscapeCharacter = Window_Message.prototype.processEscapeCharacter; Window_Message.prototype.processEscapeCharacter = function (code, textState) { switch (code) { case setting.unlockCode: $gameMessage.setWaitMode(''); break; default: _Window_Message_processEscapeCharacter.apply(this, arguments); } }; })();