Preventing item icons for being dimmed out when unusable

Hi there! I'm working on my rmmv project and one thing that bothers me is that when an item isn't usable in the item menu the icon appears dimmed alongside the item's name. Is there a way to change so that the only thing being dimmed is the item's name?

I have all these key items that aren't consumables and I would like to have their icon nice and bright instead of half-faded-out

Thank you for your help!
Items that cannot be consumed still appear normally in the menu; if you allow them to be accessible in the menus, they will appear without transparency and will have no effect when selected, since they belong to the "Key" category:
RMMV-Item-NoConsumable.png
But they wanted the name to be dimmed, just not the icon. And probably not the "ok" sound to play when selecting it.

I think you need to put in Window_ItemList methods the changePaintOpacity toggle from drawItem to drawItemName between the drawIcon and drawText. And make conditionals so that it only affects the item menu if that's what you want.

EDIT: Also, toggle it back to true at the end I think
Yes, I know, I just presented a simpler solution that is often already resolved from the OP's perspective.
Considering that to create a Plugin you would have to understand where to separate the icon, the text and the value followed by ":"

As far as I remember, opacity is applied after creating the icon design along with the text:
JavaScript:
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);
    }
};
Thank you for your help you two!
The first simpler solution would work ok enough but the second would be ideal, since I would like the player to know visually that an item isn't usable but still see the bright icon.

However I don't really understand what rpgLord69 means, I assume it's in the rpg_windows.js file of the project, but I can't quite wrap my brain around what I ought to do.
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:
RMMV-Item-NoConsumable2.png
Thank you so much for your time! this works like a charm :LZSjoy:

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Re-opened at OP's request.

Thank you so much for your time! this works like a charm :LZSjoy:
Sorry, I understood that it had worked, but it was reopened. Could you explain what was missing for it to work?
Sorry, I understood that it had worked, but it was reopened. Could you explain what was missing for it to work?
Hi! The plugin worked but ive confirmed it is making shops crash when trying to buy something, giving me the following error message:

TypeError
this.isEnabled is not a function

do you know what might be causing this?
I only made a modification to how to check if an item is consumable, but I'll change that later to only work in the player menu.

Removed due to errors

The opacity only makes sense when using an item, not when buying or selling it, but if it's good for you, I won't change it now.
Thank you Dev_With_Coffee, it doesn't seem to crash on the shop screen anymore, but is there a way to keep the opacity like default in the shop?

Right now the opacity is a little all over the place, here's a screenshot of what it looks like right now with the plugin you posted. The icons are all greyed out and the non-consumable item (thief pick) also has its text greyed out despite being buyable.

Capture.PNG
As I said here:
but if it's good for you, I won't change it now.

It's a matter of checking if it's in the store or not. I don't know if I can resolve this today, but I might have some results by Monday.
As I said here:


It's a matter of checking if it's in the store or not. I don't know if I can resolve this today, but I might have some results by Monday.
No rush at all, I greatly appreciate the help on this! Hope you have a good weekend!
I got really lucky, I found this solution and I already gave @Aerosys a LIKE:

Method:
SceneManager._scene instanceof Scene_Item

Plugin:
JavaScript:
(function() {
    /* rpg_window.js:596 */
    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);
            if(SceneManager._scene instanceof Scene_Item){
                this.changePaintOpacity(this.isEnabled(item));
            }
            this.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
        }
    };

    /* rpg_window.js:1983 */
    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);
        }
    };
})();
That did the trick! Thank you so much! :yhappy:
That's great news!

Do a few more tests and report the thread as resolved so the moderator can close it.
I just tested all the different scenarios an item icon would get rendered in and everything seems to be in order. We can close the topic again thank you!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/preventing-item-icons-for-being-dimmed-out-when-unusable.180981/