MerchantLegends

Merchant Prince Digital
Regular
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
Regular
Joined
May 22, 2018
Messages
3,361
Reaction score
2,669
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 Profile Posts

Uh... Forum test, forum test. Am I live?
New but not so new here. (Like, been lurking around as a guest). I hope to change my destiny.
That is, to make friends and learn from the community. I hope we all have fun and create memories worth keeping. :ptea:
made a face sprite for the little guy using default cat for comparison, I'm rather pleased with how it turned out!

image.png
Playing arounnd with NUUN's Battle Result as a VS Victory Aftermath alternative. Loving it so far despite the learning curve (there are a LOT of parameters)

1701665328725.png

Just have to figure out how to addin sub class progress.
Partitito's story is supposed to be about defeating poverty while thinking he is a capitalist with socialist ideas. But it's really about stories of redemption and perseverance.

Forum statistics

Threads
136,730
Messages
1,269,269
Members
180,449
Latest member
anxlye
Top