Draw Icons in Skill Names

Hello 👋
I'd like to have a plugin that allows me to use the "\i[x]" code from Text Messages to be used in the Name Window of Skills
834fb9c504.png
(like this)
Don't know how difficult this would be, but thanks in advance if you try to help me 😍
It depends more on where you want the icon/skill name to be drawn. Each Window in RMMV has two versions of draw. One with icon / text code support and one without.
I'm not even sure if it is a window at all. It's something added with Yanfly's Battle Core ( http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/ ). When you, or your enemy takes any action in battle it will be displayed at the top of the screen.
948e68f725.png

I'd love to show more than 1 icon with the enemy's skill name, so the player can get more information about the incoming attack. like multiple elements.
Copy this into a .js file and import it as a plugin.

Code:
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.drawTextEx(item.name, x + iconBoxWidth, y);
    }
};

Window_BattleLog.prototype.drawSimpleActionLine = function (index) {
   var text = this._lines[index].replace('<SIMPLE>', '');
   var rect = this.itemRectForText(index);
   this.contents.clearRect(rect.x, rect.y, rect.width, rect.height);
   var tw = this.textWidthEx(text);
   var wx = rect.x + (rect.width - tw) / 2;
   this.resetFontSettings();
   this.drawTextEx(text, wx, rect.y);
   if (this._actionIcon) {
       this.drawIcon(this._actionIcon, wx - Window_Base._iconWidth, rect.y + 2);
   }
};
@waynee95 It does work... kind of. The icons added through \i[x] get displayed perfectly, but the icons that are set normally through the skills data base entry are kinda bugged weirdly in the background.
Can you show a picture? For it's working fine.
@waynee95 Sure thing.
f5ba0aec5d.png

This is what it looks like when I'm using every skill now (without adding something via \i[x]. The standard Database Icon gets drawn behind the text somewhere in the middle.

c3f1ff8686.png

And this is what it looks like when I'm using a skill that has both, a Database Icon and an Icon added with \i[x]. The blue icon was added with
" \i[8]Dual Attack " as the name, the yellow icon behind it was the one set as the Database Icon.

f4bd85a547.png

BTW, it does get displayed perfectly fine in menus.

(Edit: I probably could just not use Database Icons at all now and would be fine. Just wanted to adress this problem for consistency reasons anyway.)
@UgyBoogie
I see. It worked for me because I use a different font and font size.
I changed the code above a bit, copy it again and see if it is better now.
@UgyBoogie
I see. It worked for me because I use a different font and font size.
I changed the code above a bit, copy it again and see if it is better now.
Wow, it works perfectly now 😀 Thank you so much for your help! 😍
Nice. 😀
Yeah got some calculations wrong in the first one, that weren't noticable with a normal font and font size.
Glad it works now!👍

Original thread: https://forums.rpgmakerweb.com/threads/draw-icons-in-skill-names.79370/