koji様
こんばんは。はじめまして。
①の件ですが実は私もPH_Warehouseを使っていて一括して預けたいと思っていたのですが
このプラグイン単体ではそういった機能を有していないようで、
仕方ないので自分用にプラグインとして作成しました。
一般には公開しない予定でしたがよければお使いください。
但しコレ以上の機能追加は私の技術不足によりできませんので申し訳ございません。
例えば指定したアイテム以外を預けるとか大事な物以外を預けるとかです。
何かこれに代わる便利なプラグインがあれば逆にどなたか紹介してほしいです(汗)
使い方はヘルプに記載してあります。
例えばアイテム武器防具を全て預けて持っているアイテム武器防具をクリアしたい場合以下のようにします。
◆プラグインコマンド:NYA_ItemStock keep
◆プラグインコマンド:NYA_ItemStock clear
アイテム武器防具を全て返してもらいたい場合以下のようにします。
◆プラグインコマンド:NYA_ItemStock restore
今持っているアイテムに預けてるアイテムを追加したい場合は以下
◆プラグインコマンド:NYA_ItemStock add
PH_Warehouseの機能追加というわけではないので変則的ですがこれで代用できないでしょうか?
②のDepositとWithdrawの入れ替えについては以下のように改変することでできました。
よろしければご参考ください。
コード: 全て選択
// Window_WarehouseOption.prototype.refresh = function() {
// var rectWithdraw = this.itemRectForText(0);
// var rectDeposit = this.itemRectForText(1);
// this.drawText(this.withdrawText, rectWithdraw.x, rectWithdraw.y, rectWithdraw.width, "center");
// this.drawText(this.depositText, rectDeposit.x, rectDeposit.y, rectDeposit.width, "center");
// };
//上記メソッドを以下に変更
Window_WarehouseOption.prototype.refresh = function() {
var rectDeposit = this.itemRectForText(0);
var rectWithdraw = this.itemRectForText(1);
this.drawText(this.depositText, rectDeposit.x, rectDeposit.y, rectDeposit.width, "center");
this.drawText(this.withdrawText, rectWithdraw.x, rectWithdraw.y, rectWithdraw.width, "center");
};
コード: 全て選択
//以下メソッドを一部変更
Window_WarehouseItemList.prototype.loadItems = function() {
// Deposit
if (PHPlugins.PHWarehouse._lastOption == 0) {//1を0にしました
if (PHPlugins.Params.PHWarehouseAllTogether == true) {
this.makeDepositAllItemList();
} else {
this.makeItemList();
}
}
// Withdraw
else if (PHPlugins.PHWarehouse._lastOption == 1) {//0を1にしました
this.makeWarehouseItemList();
}
};
追記
すみません。以下の点が漏れてました。
コード: 全て選択
//ADD以下メソッドを一部変更
Window_WarehouseItemList.prototype.drawItem = function(index) {
var item = this._data[index];
if (item) {
var numberWidth = this.numberWidth();
var rect = this.itemRect(index);
rect.width -= this.textPadding();
this.changePaintOpacity(PHPlugins.PHWarehouse.verifyItem(item));
this.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
if (PHPlugins.PHWarehouse._lastOption == 0) {//1を0にしました
this.drawItemNumber(item, rect.x, rect.y, rect.width);
} else if (PHPlugins.PHWarehouse._lastOption == 1) {//0を1にしました
this.drawWarehouseItemNumber(item, rect.x, rect.y, rect.width);
}
this.changePaintOpacity(1);
}
};
コード: 全て選択
//ADD以下メソッドを一部変更
Window_WarehouseItemList.prototype.moveItem = function() {
var item = this.item();
// Deposit
if (PHPlugins.PHWarehouse._lastOption == 0) {//1を0にしました
if (PHPlugins.PHWarehouse.checkCapacity() && PHPlugins.PHWarehouse.verifyItem(item)) {
SoundManager.playEquip();
PHPlugins.PHWarehouse.deposit(item);
$gameParty.loseItem(item, 1);
} else {
SoundManager.playBuzzer();
}
}
// Withdraw
else if (PHPlugins.PHWarehouse._lastOption == 1) {//0を1にしました
if (PHPlugins.PHWarehouse.verifyItem(item)) {
var numItems = $gameParty.numItems(item);
$gameParty.gainItem(item, 1);
if (numItems < $gameParty.numItems(item)) {
SoundManager.playEquip();
PHPlugins.PHWarehouse.withdraw(item);
} else {
SoundManager.playBuzzer();
}
} else {
SoundManager.playBuzzer();
}
}
};
コード: 全て選択
//ADD以下メソッドを一部変更
Window_WarehouseItemList.prototype.isCurrentItemEnabled = function() {
if (this._data.length > 0) {
if (PHPlugins.PHWarehouse._lastOption == 0 && PHPlugins.PHWarehouse.checkCapacity()) {//1を0にしました
return true;
} else if (PHPlugins.PHWarehouse._lastOption == 1) {//0を1にしました
return true;
} else {
return false;
}
}
return false;
};
追記
当方の環境で以下のようにしないと引き出しのとき正常に個数が表示されなかったので
個数が表示されないようでしたらお試しください。
yanfly氏のプラグインが入っていると症状が発生するようです。
コード: 全て選択
Window_WarehouseItemList.prototype.drawWarehouseItemNumber = function(item, x, y, width) {
var qtty = PHPlugins.PHWarehouse.getQuantity(item);
// if (typeof Yanfly !== "undefined") {
// this.contents.fontSize = Yanfly.Param.ItemQuantitySize;
// this.drawText('\u00d7' + qtty, x, y, width, 'right');
// this.resetFontSettings();
// } else {
this.drawText(':', x, y, width - this.textWidth('00'), 'right');
this.drawText(qtty, x, y, width, 'right');
// }
};