Scene_Menu.prototype.createCommandImages = function() {
this._menuCmdBackground = new Sprite();
this._menuCmdBackground2 = new Sprite();
this._itemButton = new Sprite_Button();
this._skillsButton = new Sprite_Button();
this._equipButton = new Sprite_Button();
this._statusButton = new Sprite_Button();
this._formationButton = new Sprite_Button();
this._saveButton = new Sprite_Button();
this._optionsButton = new Sprite_Button();
this._endButton = new Sprite_Button();
this._menuCmdBackground.bitmap = ImageManager.loadSystem(menuCommandBackground);
this._menuCmdBackground2.bitmap = ImageManager.loadSystem(menuCommandBackground2);
this._itemButton.bitmap = ImageManager.loadSystem("cmdBtn_A1");
this._skillsButton.bitmap = ImageManager.loadSystem("cmdBtn_A2");
this._equipButton.bitmap = ImageManager.loadSystem("cmdBtn_A3");
this._statusButton.bitmap = ImageManager.loadSystem("cmdBtn_A4");
this._formationButton.bitmap = ImageManager.loadSystem("cmdBtn_A5");
this._saveButton.bitmap = ImageManager.loadSystem("cmdBtn_A6");
this._optionsButton.bitmap = ImageManager.loadSystem("cmdBtn_A7");
this._endButton.bitmap = ImageManager.loadSystem("cmdBtn_A8");
this._itemButton.x = 496;
this._skillsButton.x = this._itemButton.x + 36;
this._equipButton.x = this._skillsButton.x + 36;
this._statusButton.x = this._equipButton.x + 36;
this._formationButton.x = this._statusButton.x + 36;
this._saveButton.x = this._formationButton.x + 36;
this._optionsButton.x = this._saveButton.x + 36;
this._endButton.x = this._optionsButton.x + 36;
this._itemButton.y = this._skillsButton.y = this._equipButton.y = this._statusButton.y
= this._formationButton.y = this._saveButton.y = this._optionsButton.y = this._endButton.y = this._endButton.y = 51;
this.addChild(this._itemButton);
this.addChild(this._skillsButton);
this.addChild(this._equipButton);
this.addChild(this._statusButton);
this.addChild(this._formationButton);
this.addChild(this._saveButton);
this.addChild(this._optionsButton);
this.addChild(this._endButton);
};
Scene_Menu.prototype.createCommandWindow = function() {
this._commandWindow = new Window_MenuCommand(0, 0);
this._commandWindow.visible = false;
this._commandWindow.x = Graphics.boxWidth;
this._commandWindow.y = Graphics.boxHeight;
this._commandWindow.setHandler('item', this.commandItem.bind(this));
this._commandWindow.setHandler('skill', this.commandPersonal.bind(this));
this._commandWindow.setHandler('equip', this.commandPersonal.bind(this));
this._commandWindow.setHandler('status', this.commandPersonal.bind(this));
this._commandWindow.setHandler('formation', this.commandFormation.bind(this));
this._commandWindow.setHandler('options', this.commandOptions.bind(this));
this._commandWindow.setHandler('save', this.commandSave.bind(this));
this._commandWindow.setHandler('gameEnd', this.commandGameEnd.bind(this));
this._commandWindow.setHandler('cancel', this.popScene.bind(this));
this.addWindow(this._commandWindow);
};
Scene_Menu.prototype.update = function() {
Scene_MenuBase.prototype.update.call(this);
// item image button
this._itemButton.setClickHandler(this.commandItem.bind(this));
// skill image button
this._skillsButton.setClickHandler(this.commandPersonal.bind(this));
// equip image button
this._equipButton.setClickHandler(this.commandPersonal.bind(this));
// status image button
this._statusButton.setClickHandler(this.commandPersonal.bind(this));
// formation image button
this._formationButton.setClickHandler(this.commandFormation.bind(this));
// save image button
this._saveButton.setClickHandler(this.commandSave.bind(this));
// options image button
this._optionsButton.setClickHandler(this.commandOptions.bind(this));
// end image button
this._endButton.setClickHandler(this.commandGameEnd.bind(this));
};
// This is the part where my code having trouble
Scene_Menu.prototype.commandPersonal = function() {
this._statusWindow.setFormationMode(false);
this._statusWindow.selectLast();
this._statusWindow.activate();
this._statusWindow.setHandler('ok', this.onPersonalOk.bind(this));
this._statusWindow.setHandler('cancel', this.onPersonalCancel.bind(this));
};
Scene_Menu.prototype.onPersonalOk = function() {
switch (this._commandWindow.currentSymbol()) {
case 'skill':
SceneManager.push(Scene_Skill);
break;
case 'equip':
SceneManager.push(Scene_Equip);
break;
case 'status':
SceneManager.push(Scene_Status);
break;
};
};
Scene_Menu.prototype.onPersonalCancel = function() {
this._statusWindow.deselect();
this._commandWindow.activate();
};