MerchantLegends

Merchant Prince Digital
Veteran
Joined
Jun 29, 2014
Messages
71
Reaction score
11
First Language
English
Primarily Uses
N/A
I have wrote some custom code to change the font size in specific windows... See my screenshot below. But for some reason, it isn't changing the font size of the MP cost. Any ideas what I need to do to target that font size too?

1674333575782.png


Code I am using:

Code:
  Window_BattleSkill.prototype.standardFontSize = Window_Base.prototype.standardFontSize;
  Window_BattleSkill.prototype.lineHeight = myStandardLineHeight;

And I have defined standardFontSize and myStandardLineHeight variables previously in the script.

Any help appreciated!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
3,258
Reaction score
2,530
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!

As I can see, the flow of code is this:

JavaScript:
Window_SkillList.prototype.drawItem = function(index) {
    var skill = this._data[index];
    if (skill) {
        var costWidth = this.costWidth();
        var rect = this.itemRect(index);
        rect.width -= this.textPadding();
        this.changePaintOpacity(this.isEnabled(skill));
        this.drawItemName(skill, rect.x, rect.y, rect.width - costWidth);
        this.drawSkillCost(skill, rect.x, rect.y, rect.width);
        this.changePaintOpacity(1);
    }
};

// Inherited
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.drawText(item.name, x + iconBoxWidth, y, width - iconBoxWidth);
    }
};

Window_SkillList.prototype.drawSkillCost = function(skill, x, y, width) {
    if (this._actor.skillTpCost(skill) > 0) {
        this.changeTextColor(this.tpCostColor());
        this.drawText(this._actor.skillTpCost(skill), x, y, width, 'right');
    } else if (this._actor.skillMpCost(skill) > 0) {
        this.changeTextColor(this.mpCostColor());
        this.drawText(this._actor.skillMpCost(skill), x, y, width, 'right');
    }
};

My guess is that something Is changing the font for the skill cost. Maybe another plugin, maybe you overwrite the standard font size, don't know. But something is really changing it.
I tested on a clean project and the change worked for both skill name and skill cost.
 

Latest Threads

Latest Posts

Latest Profile Posts

You know, I don't wish death on anything... There won't be any actual deaths in my games. I feel like it is an overused emotional trigger. But.. there is one thing I wish would just hurry up and die already. Like, seriously... why do you cling to life... Betelgeuse?! HURRY UP AND EXPLODE IN A GLORIOUS SUPERNOVA ALREADY!!
i never make fun of depressed people because even i feel it too. i know this feeling will go away but when im not at work or working on something i dislike very much the dark thoughts that enter my mind. big family definitely helps me not feel alone wen they get home tho , so thats good.
my inside A2 page is at a full rough draft now, as is my inside B page. Inside A4 has most of the walls I am using but is only about half full, and I have just started a rough draft of an inside C page.
My older brother and his family are arriving tomorrow from America for a holiday her in England. Been many years since I last seen them. Happy times.

Forum statistics

Threads
131,727
Messages
1,222,672
Members
173,471
Latest member
GGEZ555
Top