//============================================================================= // MessageCommon.js // ---------------------------------------------------------------------------- // Copyright (c) 2015-2017 Triacontane // This software is released under the MIT License. // http://opensource.org/licenses/mit-license.php // ---------------------------------------------------------------------------- // Version // 1.0.0 2017/05/02 初版 // ---------------------------------------------------------------------------- // [Blog] : http://triacontane.blogspot.jp/ // [Twitter]: https://twitter.com/triacontane/ // [GitHub] : https://github.com/triacontane/ //============================================================================= /*: @url https://triacontane.blogspot.com/ @plugindesc Message Common 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 ----- A common event will be invoked while displaying a message. Common events will be executed in parallel. Execute "Display text" by including the following control characters: \CE[1] # Executes common event [1]. This plugin does not have any plugin commands. 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 メッセージの表示中にコモンイベントを呼び出します。 コモンイベントは並列扱いで実行されます。 以下の制御文字を含めて「文章の表示」を実行してください。 \CE[1] # コモンイベント[1]を実行します。 このプラグインにはプラグインコマンドはありません。 利用規約: 作者に無断で改変、再配布が可能で、利用形態(商用、18禁利用等) についても制限はありません。 このプラグインはもうあなたのものです。 */ (function () { 'use strict'; //============================================================================= // Game_System // メッセージコモンイベントを更新します。 //============================================================================= Game_System.prototype.addMessageCommonEvents = function (id) { if (!this._messageCommonEvents) { this._messageCommonEvents = []; } var interpreter = new Game_Interpreter(); interpreter.setup($dataCommonEvents[id].list); this._messageCommonEvents.push(interpreter); }; Game_System.prototype.updateMessageCommonEvents = function () { if (!this._messageCommonEvents || this._messageCommonEvents.length === 0) return; this._messageCommonEvents.forEach(function (interpreter) { interpreter.update(); }); this._messageCommonEvents = this._messageCommonEvents.filter(function (interpreter) { return interpreter.isRunning(); }); }; //============================================================================= // Window_Message // メッセージコモンイベントを呼び出します。 //============================================================================= var _Window_Message_processEscapeCharacter = Window_Message.prototype.processEscapeCharacter; Window_Message.prototype.processEscapeCharacter = function (code, textState) { if (code === 'CE') { this.callMessageCommon(this.obtainEscapeParam(textState)); return; } _Window_Message_processEscapeCharacter.apply(this, arguments); }; Window_Message.prototype.callMessageCommon = function (commonEventId) { $gameSystem.addMessageCommonEvents(commonEventId); }; var _Window_Message_update = Window_Message.prototype.update; Window_Message.prototype.update = function () { $gameSystem.updateMessageCommonEvents(); _Window_Message_update.apply(this, arguments); }; })();