MV Add UI Icons to Yanfly Shop Engine Core

Hi everyone!

I need some advice for modifying a bit of code in Yanfly's Shop Engine Core.
On lines 946 and 948 the '<<' and '>>' text is drawn, which is meant to indicate to the player that they can press Left and Right to cycle between which actor's stats they're viewing while in the shop menu.
Below is an example of what I mean

Image 1.png




I don't think this is super great because it isn't clear that >> means you can press Right to cycle forward.
The UI just isn't clear enough.
I've been using a lot of Iconography in my game, trying to remove as much text as possible to replace with icons to better convey everything to the player.

What I'm asking for is some advice in how to rewrite this code to draw an icon instead of that text.
I have D-Pad left and D-Pad right icons already, and am just looking for a way to display them instead of the text.
Below is a photoshopped example of what I'm after using the icons.

Image 2.png



I've already got icons displaying for the stats, that's just a simple edit in the database, no issue there.
I'm just looking to get those two D-Pad icons displaying in game (again, that image is photoshopped as an example).
Would anyone have any advice on how to do this?

Thankyou!
you do need small modification to replace them, I don't have time now.
but can help how to add them later on to add the processIcon and
the other one so you can draw the icon from the shop anywhere in the code.

but find this code inside the shop if its not there, add them:

JavaScript:
    Window_Name.prototype.processDrawIcon = function(iconIndex, textState) {
        this.drawIcon(iconIndex, textState.x + 2, textState.y + 2);
        textState.x += Window_Base._iconWidth + 4;
    };

    Window_Name.prototype.drawIcon = function(iconIndex, x, y) {
        const bitmap = ImageManager.loadSystem("IconSet");
        const pw = 32;
        const ph = 32;
        const sx = iconIndex % 16 * pw;
        const sy = Math.floor(iconIndex / 16) * ph;
        const dw = this._fontSize * 1.1;
        const dh = dw;
        this.contents.blt(bitmap, sx, sy, pw, ph, x, y, dw, dh);
    };

change Name to the window you target for << and >> and replace that with
drawIcon(id, x, y) which you can add manually.

I can't help you now, but can later if you get stuck.
Hi, thanks for your help!
I'm not fully sure I understand what this means though... I'm not all that handy with JavaScript.
I only have a limited understanding of C# so this pretty far out of my knowledge-base.

Could you please be a little more specific and detailed as to how exactly I need to implement the above code and where?

I really appreciate your help!
I think you can just replace the draw text with draw icon. Change icon id (currently 1), and if you're using nonstandard icon size, change that -32:

Window_ShopStatus.prototype.drawActorDisplayed = function(actor) {
var text = actor.name();
this.changeTextColor(this.normalColor());
this.drawText(text, 0, this.lineHeight(), this.contents.width, 'center');
this.changeTextColor(this.systemColor());
// var text = '<<';
// this.drawText(text, 0, this.lineHeight(), this.contents.width, 'left');
this.drawIcon(1, 0, this.lineHeight());
// var text = '>>';
// this.drawText(text, 0, this.lineHeight(), this.contents.width, 'right');
this.drawIcon(1, this.contents.width - 32, this.lineHeight());
};
This worked perfectly, doesn't seem to have caused any bugs either!
Thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/add-ui-icons-to-yanfly-shop-engine-core.180853/