Source: Window_StatusParams.js

Window_StatusParams.js

//-----------------------------------------------------------------------------
// Window_StatusParams
//
// The window for displaying parameters on the status screen.
/**
 * The window for displaying parameters on the status screen.
 *
 * @class
 * @extends Window_StatusBase
 */
function Window_StatusParams() {
    this.initialize(...arguments);
}

Window_StatusParams.prototype = Object.create(Window_StatusBase.prototype);
Window_StatusParams.prototype.constructor = Window_StatusParams;

Window_StatusParams.prototype.initialize = function(rect) {
    Window_StatusBase.prototype.initialize.call(this, rect);
    this._actor = null;
};

/**
 * Sets the actor object for the window
 *
 * @param {Game_Actor} actor - The Game Actor object
 */
Window_StatusParams.prototype.setActor = function(actor) {
    if (this._actor !== actor) {
        this._actor = actor;
        this.refresh();
    }
};

/**
 * Gets the max amount of items in the window
 *
 * @return {number} Amount of items
 */
Window_StatusParams.prototype.maxItems = function() {
    return 6;
};

/**
 * Gets the height of an item
 *
 * @return {number} Height of an item
 */
Window_StatusParams.prototype.itemHeight = function() {
    return this.lineHeight();
};

/**
 * Draws the item info at the given index
 *
 * @param {number} index - The index to draw
 */
Window_StatusParams.prototype.drawItem = function(index) {
    const rect = this.itemLineRect(index);
    const paramId = index + 2;
    const name = TextManager.param(paramId);
    const value = this._actor.param(paramId);
    this.changeTextColor(ColorManager.systemColor());
    this.drawText(name, rect.x, rect.y, 160);
    this.resetTextColor();
    this.drawText(value, rect.x + 160, rect.y, 60, "right");
};

/**
 * Draws the item background
 */
Window_StatusParams.prototype.drawItemBackground = function(/*index*/) {
    //
};