MV Show a state resist icon inside status window.

Hi.,

I would like to add an icon to show the resistance to a certain state in the status window of each hero.
Just showing one icon is ok to me.


As example of what I want:


111.png
222.png




As you can see I'm asking for the text plus the icon of the first resisted state.


Thanks!.
Hi! Saving this code as a .js file and adding it as a plugin will accomplish what you are requesting.

JavaScript:
Window_Status.prototype.drawBasicInfo = function(x, y) {
    var lineHeight = this.lineHeight();
    this.drawActorLevel(this._actor, x, y + lineHeight * 0);
    this.drawActorStateResist(x, y + lineHeight * 1);
    this.drawActorHp(this._actor, x, y + lineHeight * 2);
    this.drawActorMp(this._actor, x, y + lineHeight * 3);
};
Window_Status.prototype.drawActorStateResist = function(x, y) {
    const stateId = this._actor.stateResistSet()[0];
    if (stateId) {
        const label = 'Resist';
        const icon = $dataStates[stateId].iconIndex;
        const iconX = this.textWidth(label) + 25;
        this.drawText(label, x, y, 100, 'left');
        this.drawIcon(icon, x + iconX, y);
    }
};

Here's a preview:

gif.gif


As a quick note, the area that you requested be used for the "Resist" information is normally used to display the actor's state icons. Those state icons have been disabled to accommodate your request.
Hi! Saving this code as a .js file and adding it as a plugin will accomplish what you are requesting.

JavaScript:
Window_Status.prototype.drawBasicInfo = function(x, y) {
    var lineHeight = this.lineHeight();
    this.drawActorLevel(this._actor, x, y + lineHeight * 0);
    this.drawActorStateResist(x, y + lineHeight * 1);
    this.drawActorHp(this._actor, x, y + lineHeight * 2);
    this.drawActorMp(this._actor, x, y + lineHeight * 3);
};
Window_Status.prototype.drawActorStateResist = function(x, y) {
    const stateId = this._actor.stateResistSet()[0];
    if (stateId) {
        const label = 'Resist';
        const icon = $dataStates[stateId].iconIndex;
        const iconX = this.textWidth(label) + 25;
        this.drawText(label, x, y, 100, 'left');
        this.drawIcon(icon, x + iconX, y);
    }
};

Here's a preview:

View attachment 189766

As a quick note, the area that you requested be used for the "Resist" information is normally used to display the actor's state icons. Those state icons have been disabled to accommodate your request.
Thank you so much. It works perfectly.

Don't worry about state icons. I'm not using them.

Original thread: https://forums.rpgmakerweb.com/threads/show-a-state-resist-icon-inside-status-window.136680/