Where does the default Battlestatus window refresh?

Grilled Mormons

Villager
Member
Joined
Feb 15, 2016
Messages
10
Reaction score
0
First Language
English
Primarily Uses
N/A
I've been searching through default scripts and can't find it, whenever HP/MP/TP is modified via damage or whatever it refreshes the battle status window, It's really hard to edit this one window without causing a chain of errors so I decided to just stash it off-screen and just make a new window for my custom HUD, but I have no idea how to refresh it without using its update method which is a bit overkill.

for reference:
JavaScript:
//-----------------------------------------------------------------------------
// Window_BattleStatus
//
// The window for displaying the status of party members on the battle screen.

function Window_BattleStatus() {
    this.initialize.apply(this, arguments);
}

Window_BattleStatus.prototype = Object.create(Window_Selectable.prototype);
Window_BattleStatus.prototype.constructor = Window_BattleStatus;

Window_BattleStatus.prototype.initialize = function() {
    var width = this.windowWidth();
    var height = this.windowHeight();
    var x = Graphics.boxWidth - width;
    var y = Graphics.boxHeight - height;
    Window_Selectable.prototype.initialize.call(this, x, y, width, height);
    this.refresh();
    this.openness = 0;
};

Window_BattleStatus.prototype.windowWidth = function() {
    return Graphics.boxWidth - 192;
};

Window_BattleStatus.prototype.windowHeight = function() {
    return this.fittingHeight(this.numVisibleRows());
};

Window_BattleStatus.prototype.numVisibleRows = function() {
    return 4;
};

Window_BattleStatus.prototype.maxItems = function() {
    return $gameParty.battleMembers().length;
};

Window_BattleStatus.prototype.refresh = function() {
    this.contents.clear();
    this.drawAllItems();
};

Window_BattleStatus.prototype.drawItem = function(index) {
    var actor = $gameParty.battleMembers()[index];
    this.drawBasicArea(this.basicAreaRect(index), actor);
    this.drawGaugeArea(this.gaugeAreaRect(index), actor);
};

Window_BattleStatus.prototype.basicAreaRect = function(index) {
    var rect = this.itemRectForText(index);
    rect.width -= this.gaugeAreaWidth() + 15;
    return rect;
};

Window_BattleStatus.prototype.gaugeAreaRect = function(index) {
    var rect = this.itemRectForText(index);
    rect.x += rect.width - this.gaugeAreaWidth();
    rect.width = this.gaugeAreaWidth();
    return rect;
};

Window_BattleStatus.prototype.gaugeAreaWidth = function() {
    return 330;
};

Window_BattleStatus.prototype.drawBasicArea = function(rect, actor) {
    this.drawActorName(actor, rect.x + 0, rect.y, 150);
    this.drawActorIcons(actor, rect.x + 156, rect.y, rect.width - 156);
};

Window_BattleStatus.prototype.drawGaugeArea = function(rect, actor) {
    if ($dataSystem.optDisplayTp) {
        this.drawGaugeAreaWithTp(rect, actor);
    } else {
        this.drawGaugeAreaWithoutTp(rect, actor);
    }
};

Window_BattleStatus.prototype.drawGaugeAreaWithTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x + 0, rect.y, 108);
    this.drawActorMp(actor, rect.x + 123, rect.y, 96);
    this.drawActorTp(actor, rect.x + 234, rect.y, 96);
};

Window_BattleStatus.prototype.drawGaugeAreaWithoutTp = function(rect, actor) {
    this.drawActorHp(actor, rect.x + 0, rect.y, 201);
    this.drawActorMp(actor, rect.x + 216,  rect.y, 114);
};
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
1,914
Reaction score
922
First Language
Spanish
Primarily Uses
RMVXA
at draw time, at the end of every turn, at the end of every action, on item use, and on counterattack.

so, basically, *always*, except not *at every frame*
 

Ossra

Formerly Exhydra
Veteran
Joined
Aug 21, 2013
Messages
965
Reaction score
708
First Language
English
Primarily Uses
RMMV
@Grilled Mormons Hmm, well, within 'Scene_Battle' the status screen (set to the '_statusWindow' property) is updated via the 'refreshStatus' function which is called within the 'startPartyCommandSelection' function.

Code:
// The status window is created here ...
Scene_Battle.prototype.createStatusWindow = function() {
    this._statusWindow = new Window_BattleStatus();
    this.addWindow(this._statusWindow);
};

// And refreshed here via the 'refresh' function ...
Scene_Battle.prototype.refreshStatus = function() {
    this._statusWindow.refresh();
};

Scene_Battle.prototype.startPartyCommandSelection = function() {
    this.refreshStatus();
    this._statusWindow.deselect();
    this._statusWindow.open();
    this._actorCommandWindow.close();
    this._partyCommandWindow.setup();
};
The status window is also set and refreshed within BattleManager, which is done when turns are processed and so on.

Code:
BattleManager.refreshStatus = function() {
    this._statusWindow.refresh();
};
BattleManager.processTurn, BattleManager.endTurn, BattleManager.startAction, and BattleManager.invokeAction are where the window is also refreshed.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Here's a sample of some pixel edits I made.

Maybe for use as sidewalks.

If you want to use them, Credit me and Enterbrain for this. Only for use with rpgmaker vxace
If there are any mods or admins online, could you please see about the re-translation pages for RPG Maker MV? They are all down :rsad:
Werewolf cons: you lose control of yourself once a month and could accidentally kill your friends. Vampire cons: no garlic bread. The choice is simple. Werewolf for sure.
2 huge market drops in 2 days. So glad I sold my non-dividend stocks about 2 weeks ago. And if the dividend ones drop heavily, hey more cheap stocks for me!
My tutorial is live! It covers using Yanfly's weapon unleash to replace the basic attack skill with a more dynamic version depending on which weapon type the actor has equipped. It also includes how to import a custom function used to generate a random number within supplied minimum and maximum values, used in the replaced skills, to give weapons a set damage range.

Forum statistics

Threads
94,523
Messages
921,591
Members
124,376
Latest member
Darkyyy
Top