In Window_MenuStatus, it uses actor(index) to get data of the game party member at that index.
But I don't understand this part, why the index is init as -1. And when the prototype.drawItem(index) run, the index will be like: 0, 1, 2, 3, 4... depends on the value that prototype.maxItems returns, could you tell me more about this?
JavaScript:
Window_MenuStatus.prototype.actor = function(index) {
return $gameParty.members()[index];
};
Window_MenuStatus.prototype.processOk = function() {
Window_StatusBase.prototype.processOk.call(this);
const actor = this.actor(this.index());
$gameParty.setMenuActor(actor);
};
Window_MenuStatus.prototype.isCurrentItemEnabled = function() {
if (this._formationMode) {
const actor = this.actor(this.index());
return actor && actor.isFormationChangeOk();
} else {
return true;
}
};
But I don't understand this part, why the index is init as -1. And when the prototype.drawItem(index) run, the index will be like: 0, 1, 2, 3, 4... depends on the value that prototype.maxItems returns, could you tell me more about this?
JavaScript:
Window_Selectable.prototype.initialize = function(rect) {
Window_Scrollable.prototype.initialize.call(this, rect);
this._index = -1;
}
Window_Selectable.prototype.index = function() {
return this._index;
};