152 lines
4.8 KiB
JavaScript
152 lines
4.8 KiB
JavaScript
//=============================================================================
|
|
// MPP_RemovoEquipText.js
|
|
//=============================================================================
|
|
// Copyright (c) 2017 Mokusei Penguin
|
|
// Released under the MIT license
|
|
// http://opensource.org/licenses/mit-license.php
|
|
//=============================================================================
|
|
|
|
/*:
|
|
* @plugindesc 【ver.1.1】装備画面で装備後のアイテムを選択する際、一番左上の空白に「はずす」などの文字を入れます。
|
|
* @author 木星ペンギン
|
|
*
|
|
* @help
|
|
*
|
|
* ================================
|
|
* 制作 : 木星ペンギン
|
|
* URL : http://woodpenguin.blog.fc2.com/
|
|
*
|
|
* @param TextWeapon
|
|
* @desc 表示する文字列(武器)
|
|
* @default 《武器を外す》
|
|
*
|
|
* @param HelpWeapon
|
|
* @desc ヘルプ文に表示する文字列(武器)
|
|
* @default 武器を外します。
|
|
*
|
|
* @param TextArmor
|
|
* @desc 表示する文字列(衣装)
|
|
* @default 《服を脱ぐ》
|
|
*
|
|
* @param HelpArmor
|
|
* @desc ヘルプ文に表示する文字列(衣装)
|
|
* @default 防具を外します。
|
|
*
|
|
* @param TextAccessory
|
|
* @desc 表示する文字列(装飾品)
|
|
* @default 《装飾品を外す》
|
|
*
|
|
* @param HelpAccessory
|
|
* @desc ヘルプ文に表示する文字列(装飾品)
|
|
* @default 装飾品を外します。
|
|
*
|
|
* @param Text X
|
|
* @desc 表示するX座標
|
|
* @default 0
|
|
*
|
|
* @param Text Enabled
|
|
* @desc 文字列を有効状態で表示するかどうか
|
|
* (trueで白, falseでグレー)
|
|
* @default true
|
|
*
|
|
* @param Text Variables
|
|
* @type variable
|
|
* @desc メッセージを格納する変数を指定します
|
|
* @default 1
|
|
* @min 1
|
|
*
|
|
* @param EquipCondition
|
|
* @desc 装備を解除できる条件を記述します。(NoWeaponDisabled.jsと同じにする)
|
|
* @default true
|
|
*
|
|
*
|
|
*/
|
|
|
|
(function () {
|
|
|
|
var MPPlugin = { params: PluginManager.parameters('MPP_RemovoEquipText') };
|
|
|
|
MPPlugin.TextWeapon = MPPlugin.params['TextWeapon'];
|
|
MPPlugin.HelpWeapon = MPPlugin.params['HelpWeapon'];
|
|
MPPlugin.TextArmor = MPPlugin.params['TextArmor'];
|
|
MPPlugin.HelpArmor = MPPlugin.params['HelpArmor'];
|
|
MPPlugin.TextAccessory = MPPlugin.params['TextAccessory'];
|
|
MPPlugin.HelpAccessory = MPPlugin.params['HelpAccessory'];
|
|
MPPlugin.TextX = Number(MPPlugin.params['Text X'] || 6);
|
|
MPPlugin.TextEnabled = !!eval(MPPlugin.params['Text Enabled']);
|
|
MPPlugin.TextVariables = !!eval(MPPlugin.params['Text Variables']);
|
|
MPPlugin.EquipCondition = (MPPlugin.params['EquipCondition']);
|
|
|
|
var Alias = {};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Window_EquipItem
|
|
|
|
if (Window_EquipItem.prototype.hasOwnProperty('makeItemList')) {
|
|
Alias.WiEqIt_drawItem = Window_EquipItem.prototype.makeItemList;
|
|
}
|
|
Window_EquipItem.prototype.makeItemList = function() {
|
|
if (Alias.WiEqIt_drawItem) {
|
|
Alias.WiEqIt_drawItem.call(this);
|
|
} else {
|
|
Window_ItemList.prototype.makeItemList.call(this);
|
|
}
|
|
if (this._data.indexOf(null) === this._data.length - 1) {
|
|
if(!$gameActors.actor(1).equips()[1]){
|
|
this._data = this._data.slice(0, -1);
|
|
}
|
|
}
|
|
};
|
|
|
|
if (Window_EquipItem.prototype.hasOwnProperty('drawItem')) {
|
|
Alias.WiEqIt_drawItem = Window_EquipItem.prototype.drawItem;
|
|
}
|
|
Window_EquipItem.prototype.drawItem = function(index) {
|
|
var item = this._data[index];
|
|
if (!item && this._actor && this._slotId >= 0) {
|
|
var rect = this.itemRect(index);
|
|
rect.width -= this.textPadding();
|
|
this.changePaintOpacity(MPPlugin.TextEnabled);
|
|
var tx = MPPlugin.TextX;
|
|
var text = ""
|
|
switch(this._slotId){
|
|
case 0:
|
|
text += "\\I[1118]\\C[4]" + MPPlugin.TextWeapon;
|
|
$gameVariables.setValue(MPPlugin.TextVariables,MPPlugin.HelpWeapon)
|
|
break;
|
|
case 1:
|
|
$gameVariables.setValue(MPPlugin.TextVariables,MPPlugin.HelpArmor)
|
|
if(new Function( "return !!("+ MPPlugin.EquipCondition + ");" )()){
|
|
text += "\\I[1118]\\C[4]" + MPPlugin.TextArmor;
|
|
}
|
|
else{
|
|
text += "\\I[1119]\\C[7]" + MPPlugin.TextArmor;
|
|
}
|
|
$gameVariables.setValue("\\C[4]" + MPPlugin.TextVariables,MPPlugin.HelpArmor)
|
|
break;
|
|
case 2:
|
|
case 3:
|
|
case 4:
|
|
case 5:
|
|
text += "\\I[1118]\\C[4]" + MPPlugin.TextAccessory;
|
|
$gameVariables.setValue(MPPlugin.TextVariables,MPPlugin.HelpAccessory)
|
|
break;
|
|
default:
|
|
$gameVariables.setValue(MPPlugin.TextVariables,"")
|
|
break;
|
|
}
|
|
text += "\\C[0]"
|
|
this.drawTextEx(text, rect.x + tx, rect.y-2, rect.width - tx);
|
|
this.changePaintOpacity(true);
|
|
} else {
|
|
if (Alias.WiEqIt_drawItem) {
|
|
Alias.WiEqIt_drawItem.call(this, index);
|
|
} else {
|
|
Window_ItemList.prototype.drawItem.call(this, index);
|
|
}
|
|
}
|
|
};
|
|
|
|
|
|
|
|
})();
|