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,912
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 Posts

Latest Profile Posts

my profile has gotten so inaccurate.
I wrote this years ago, only now I posted an english version. How about we talk about procrastination?
I just noticed the minigame challenge. Now considering...
My project just started lagging during battletest and I haven't been able to figure out why...

Forum statistics

Threads
94,473
Messages
921,214
Members
124,317
Latest member
OmaRDeLaStreet
Top