I included the check to see if access to the item is available in the "
drawItemName" function, but after the icon has already been drawn.
In the drawItem function, I replaced the line that calls "
drawItemName" with the line that changes the opacity.
Insert this code into a JS file with any name you prefer and save it in
Plugins folder:
JavaScript:
Window_Base.prototype.drawItemName = function(item, x, y, width) {
width = width || 312;
if (item) {
var iconBoxWidth = Window_Base._iconWidth + 4;
this.resetTextColor();
this.drawIcon(item.iconIndex, x + 2, y + 2);
this.changePaintOpacity(this.isEnabled(item));
this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
}
};
Window_ItemList.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.drawItemName(item, rect.x, rect.y, rect.width - numberWidth);
this.changePaintOpacity(this.isEnabled(item));
this.drawItemNumber(item, rect.x, rect.y, rect.width);
this.changePaintOpacity(1);
}
};
I know it's just a quick replacement of the functions I did, so I assume someone could rewrite the functions in a way that doesn't conflict with other plugins. Sorry, I really don't have time right now.
It seems to work: