I'm trying to make the number of commands displayed in the command window during the battle to suit each actor, in this case my main actor Leasha has 8 commands, my second actor named Xeras has 6 and the rest 5, for some reason Reason with the code I made, it only takes the last line and all are put with 5 commands, what's wrong with this code, why doesn't it allow my actor 1 and 2 to change their commands as I put it in the code?
JavaScript:
const alias = Scene_Battle.prototype.actorCommandWindowRect;
Scene_Battle.prototype.actorCommandWindowRect = function() {
const rect = alias.apply(this, arguments);
if (BattleManager.actor() == $gameActors.actor(1).name()) {
rect.height = this.calcWindowHeight(8, true);
} else if (BattleManager.actor() == $gameActors.actor(2).name()) {
rect.height = this.calcWindowHeight(6, true);
} else {
rect.height = this.calcWindowHeight(5, true);
}
return rect;