do-disciplinary-committee-m.../www/js/plugins/BB_IconChainTextEx.js
2025-05-04 14:43:03 -05:00

78 lines
No EOL
2.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//=============================================================================
// BB_IconChainTextEx.js
// Copyright (c) 2017 BB ENTERTAINMENT
//=============================================================================
/*:
* @plugindesc アイコンを隙間なく連続で表示する制御文字を追加するプラグイン
* @author ビービー
*
* @param DrawIconChain
* @desc アイコンを連続して表示する個数
* デフォルト4
* @default 4
*
* @help 【プラグインの説明】
* アイコンをパラメータで指定した数だけ連続して表示する制御文字\D[n]と
* アイコン表示後の隙間を無くし任意の数だけアイコンを連続して表示できる
* 制御文字\E[n]を追加します。nにはアイコン番号を指定
*
* 【パラメータ】
* DrawIconChain
* 連続して表示するアイコンの数を指定します。
*
* 【使用例】
* \D[5]
* パラメータDrawIconChainが4のとき
* アイコン番号58のアイコン4つが隙間なく連続して表示されます。
*
* \E[5]\E[6]\I[7]
* アイコン番号57のアイコン3つが隙間なく連続して表示されます。
* 末尾を\I[n]にしないと次の文字との隙間が無くなるので注意してください。
*
* 【利用規約】
* このプラグインは、MITライセンスのもとで公開されています。
* Copyright (c) 2017 BB ENTERTAINMENT
* Released under the MIT License.
* http://opensource.org/licenses/mit-license.php
*
* コンタクト:
* BB ENTERTAINMENT Twitter: https://twitter.com/BB_ENTER/
* BB ENTERTAINMENT BLOG : http://bb-entertainment-blog.blogspot.jp/
*/
(function() {
'use strict';
//-----------------------------------------------------------------------------
// プラグインパラメータ管理
var parameters = PluginManager.parameters('BB_IconChainTextEx');
var BBIC = Number(parameters['DrawIconChain']);
var _Window_Base_prototype_processEscapeCharacter = Window_Base.prototype.processEscapeCharacter;
Window_Base.prototype.processEscapeCharacter = function(code, textState) {
_Window_Base_prototype_processEscapeCharacter.call(this, code, textState);
switch (code) {
case 'D':
this.processDrawIconChain(this.obtainEscapeParam(textState), textState);
break;
case 'E':
this.processDrawIconEach(this.obtainEscapeParam(textState), textState);
break;
}
};
Window_Base.prototype.processDrawIconChain = function(iconIndex, textState) {
for(var i = 0; i < BBIC; i++){
this.drawIcon(iconIndex + i, textState.x + 2, textState.y + 2);
textState.x += Window_Base._iconWidth;
}
textState.x += 4;
};
Window_Base.prototype.processDrawIconEach = function(iconIndex, textState) {
this.drawIcon(iconIndex, textState.x + 2, textState.y + 2);
textState.x += Window_Base._iconWidth;
};
})();