Window_ItemList.prototype.makeItemList = function() {
this._data = $gameParty.allItems().filter(item => this.includes(item));
if (this.includes(null)) {
this._data.push(null);
}
// 按照“x>”顺序重新排序物品
this._data.sort((a, b) => {
let aOrderNum = parseInt(a.name.split(">")[0]);
let bOrderNum = parseInt(b.name.split(">")[0]);
return aOrderNum - bOrderNum;
});
};
Window_ItemList.prototype.drawItem = function(index) {
const item = this.itemAt(index);
// 显示物品名称时,去掉“x>”
let newItemName = item.name.split(">")[1];
if (newItemName) item.name = newItemName;
if (item) {
const numberWidth = this.numberWidth();
const rect = this.itemLineRect(index);
this.changePaintOpacity(this.isEnabled(item));
this.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
this.drawItemNumber(item, rect.x, rect.y, rect.width);
this.changePaintOpacity(1);
}
};