I'm using "\i[x]" on skill type and it's working great. But I have an issue where it actually displays the entire name along with the "/i[x]" in the skill menu when the game is being played. It looks very odd and like a bug. Is there anyway to not make this appear in the actual game but still keep the icon code?
How to remove "\i[x]" from skill window in main menu.
RPG Maker MZ SupportStill can't seem to find a way to do this. Does anyone else have any experience with this?
Welp, I wasted about 30 mins looking for a plugin.
I know they exist but I can't find them either.
So instead I'll just show you what you can change in the scripts.
I believe your issue is with the command menu items, which don't process escape characters like \I[n]
In RMMZ_Windows.js there are 2 functions; drawText() and drawTextEx()
drawTextEx() will process escape characters and draw icons.
By default, when the game creates a menu command it's using the plain drawText() function.
So the really really simple solution is to change this to drawTextEx().
The catch is that drawTextEx() doesn't do alignment. Most commands like "New Game" and the Main Menu items are "center" aligned. Changing this would align the text to the left, which is probably fine if you want a \I[n] infront of all the commands.
But perhaps you just want this for the skill type window list. In that case, you just need an if-statement that'll use drawTextEx() for the SkillType window and the ordinary drawText() for everything else.
[img]https://i.imgur.com/Au0hXVl.png[/img]
I know they exist but I can't find them either.
So instead I'll just show you what you can change in the scripts.
I believe your issue is with the command menu items, which don't process escape characters like \I[n]
In RMMZ_Windows.js there are 2 functions; drawText() and drawTextEx()
drawTextEx() will process escape characters and draw icons.
By default, when the game creates a menu command it's using the plain drawText() function.
So the really really simple solution is to change this to drawTextEx().
The catch is that drawTextEx() doesn't do alignment. Most commands like "New Game" and the Main Menu items are "center" aligned. Changing this would align the text to the left, which is probably fine if you want a \I[n] infront of all the commands.
But perhaps you just want this for the skill type window list. In that case, you just need an if-statement that'll use drawTextEx() for the SkillType window and the ordinary drawText() for everything else.
JavaScript:
Window_Command.prototype.drawItem = function(index) {
const rect = this.itemLineRect(index);
const align = this.itemTextAlign();
this.resetTextColor();
this.changePaintOpacity(this.isCommandEnabled(index));
if (this.constructor.name == "Window_SkillType"){this.drawTextEx(this.commandName(index), rect.x, rect.y, rect.width); //modified
}else{
this.drawText(this.commandName(index), rect.x, rect.y, rect.width, align); //original
};
};
[img]https://i.imgur.com/Au0hXVl.png[/img]
Rather than doing that, why not just replace Window_SkillType.prototype.drawItem rather than the one for Window_Command?
It works! Thank you so much, this was bugging me for days and couldn't find anything on it.
Window_SkillType doesn't have it's own drawItem(). It has makeCommandList() and addCommand(). You can make some changes to a command's name there.
I've done that before while changing the way "sealed" skill types are displayed
Normally there is no visual change to the Skill Type Window list, only the Skill List. For example when a character is Silenced or Dead. Maybe "magic" should be greyed out or hidden entirely.
[img]https://i.imgur.com/kolUghe.png[/img]
So you could change the Skill Type name on a text string level. Like "magic \i[1]" into "magic \i[2]" or just "magic"
But ultimately, parsing the escape character to display icons is done with drawTextEx().
It doesn't have its own, but you can write one for it and it will use that instead of the one from its parent class. I overload functions this way all the time for derived classes.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-remove-i-x-from-skill-window-in-main-menu.154825/