Keep icon opacity when an item is unusable?

When an item is not consumable, the text opacity is reduced so it looks grayed out. The thing is that the icon is also affected by that (as I figure they are both drawn together in the code).

Would it be possible to change that behavior, but only for the icons? I'd like the text to still remain "grayed out".
Copy the below into a text editor, save it as a *.js file and include it as a plugin.

I haven't tested it extensively, so if you find a situation where it doesn't work as expected, or where it causes an error, you might have to add some new methods that are specific to the window being used.

Code:
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.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);
    }
};

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);
    }
};
Thank you so, so much! It works perfectly.
Does the .js work on MZ as well, or is there a similar code available somewhere?
Does the .js work on MZ as well, or is there a similar code available somewhere?
You could try it but probably not since MV and MZ use different window conventions. It looks like all he did was redeclare a couple functions and comment out a line of code so if you could find the MZ equivalent section in the source code you could do the same thing.
@NonexistentRPG As @AquaEcho mentioned, the same functions exist in MZ but their contents are different.

It should be pretty easy for you to do a search in your rmmz_windows file, find them, and look at the changes I made; but here they are for you (because it's simple for me, too!):
Code:
Window_ItemList.prototype.drawItem = function(index) {
    const item = this.itemAt(index);
    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);
    }
};

Window_Base.prototype.drawItemName = function(item, x, y, width) {
    if (item) {
        const iconY = y + (this.lineHeight() - ImageManager.iconHeight) / 2;
        const textMargin = ImageManager.iconWidth + 4;
        const itemWidth = Math.max(0, width - textMargin);
        this.resetTextColor();
        this.drawIcon(item.iconIndex, x, iconY);
        this.changePaintOpacity(this.isEnabled(item));
        this.drawText(item.name, x + textMargin, y, itemWidth);
    }
};
@NonexistentRPG , please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/keep-icon-opacity-when-an-item-is-unusable.155941/