【解決】アイテム欄の分類を増やす
Posted: 2016年12月31日(土) 13:39
メニュー項目についての質問です。デフォルトのアイテム欄は「アイテム,武器,防具,大事なもの」と4つに分類されていますが、ここを5つ以上に増やす方法はありますでしょうか?
4つだけのくくりだと、たとえば入手した防具がどの装備タイプなのかがとても分かりにくく感じてしまい、細かく分けられたらいいのになと思った次第です…。コード: 全て選択
//-----------------------------------------------------------------------------
// アイテムリストに表示するカテゴリの数
var _Window_ItemCategory_prototype_maxCols = Window_ItemCategory.prototype.maxCols;
Window_ItemCategory.prototype.maxCols = function() {
return 5;
};
//-----------------------------------------------------------------------------
// アイテムリストに表示する名前
var _Window_ItemCategory_prototype_makeCommandList = Window_ItemCategory.prototype.makeCommandList;
Window_ItemCategory.prototype.makeCommandList = function() {
this.addCommand(TextManager.item, 'item');
this.addCommand(TextManager.weapon, 'weapon');
this.addCommand(TextManager.armor, 'armor');
this.addCommand("アビリティ", 'ability');
this.addCommand(TextManager.keyItem, 'keyItem');
};
//-----------------------------------------------------------------------------
// カテゴリの中に表示するアイテムのID
var _Window_ItemList_prototype_includes = Window_ItemList.prototype.includes;
Window_ItemList.prototype.includes = function(item) {
switch (this._category) {
case 'item':
return DataManager.isItem(item) && item.itypeId === 1;
case 'weapon':
return DataManager.isWeapon(item);
case 'armor':
return DataManager.isArmor(item) && item.etypeId >= 3 && item.etypeId <= 4;
case 'ability':
return DataManager.isArmor(item) && item.etypeId === 5;
case 'keyItem':
return DataManager.isItem(item) && item.itypeId === 2;
default:
return false;
}
};