function Window_ActorState() {
this.initialize.apply(this, arguments);
}
Window_ActorState.prototype = Object.create(Window_Command.prototype);
Window_ActorState.prototype.constructor = Window_ActorState;
Window_ActorState.prototype.initialize = function() {
var y = Graphics.boxHeight - this.windowHeight();
Window_Command.prototype.initialize.call(this, 0, y);
this.openness = 0;
this.deactivate();
this._actor = null;
};
Window_ActorState.prototype.windowWidth = function() {
return 192;
};
Window_ActorState.prototype.numVisibleRows = function() {
return 4;
};
Window_ActorState.prototype.makeCommandList = function() {
if (this._actor) {
this.addAttackCommand();
this.addSkillCommands();
this.addGuardCommand();
this.addItemCommand();
}
};
Window_ActorState.prototype.addAttackCommand = function() {
this.addCommand(TextManager.attack, 'attack', this._actor.canAttack());
};
Window_ActorState.prototype.addSkillCommands = function() {
var skillTypes = this._actor.addedSkillTypes();
skillTypes.sort(function(a, b) {
return a - b;
});
skillTypes.forEach(function(stypeId) {
var name = $dataSystem.skillTypes[stypeId];
this.addCommand(name, 'skill', true, stypeId);
}, this);
};
Window_ActorState.prototype.addGuardCommand = function() {
this.addCommand(TextManager.guard, 'guard', this._actor.canGuard());
};
Window_ActorState.prototype.addItemCommand = function() {
this.addCommand(TextManager.item, 'item');
};
Window_ActorState.prototype.setup = function(actor) {
this._actor = actor;
this.clearCommandList();
this.makeCommandList();
this.refresh();
this.selectLast();
this.activate();
this.open();
};
Window_ActorState.prototype.processOk = function() {
if (this._actor) {
if (ConfigManager.commandRemember) {
this._actor.setLastCommandSymbol(this.currentSymbol());
} else {
this._actor.setLastCommandSymbol('');
}
}
Window_Command.prototype.processOk.call(this);
};
Window_ActorState.prototype.selectLast = function() {
this.select(0);
if (this._actor && ConfigManager.commandRemember) {
var symbol = this._actor.lastCommandSymbol();
this.selectSymbol(symbol);
if (symbol === 'skill') {
var skill = this._actor.lastBattleSkill();
if (skill) {
this.selectExt(skill.stypeId);
}
}
}
};