/*:
* @plugindesc Tales of Aeria Menu Changes
* @author kR1pt0n1t3 with help from Magnus4fun
* @help
*/
/////////////////////////////////////////////////////////////////////////////
(function() {
function myMenuStatusWindow() {
this.initialize.apply(this, arguments);
};
myMenuStatusWindow.prototype = Object.create(Window_Base.prototype);
myMenuStatusWindow.prototype.constructor = myMenuStatusWindow;
myMenuStatusWindow.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
myMenuStatusWindow.prototype.refresh = function() {
this.contents.clear();
$gameTemp.reserveCommonEvent(2);
if($gameVariables.value(6) == 1){
this.drawPicture('Maya', 0, 0);
}
};
/////////////////////////////////////////////////////////////////////////////
function myMenuTop() {
this.initialize.apply(this, arguments);
};
myMenuTop.prototype = Object.create(Window_Base.prototype);
myMenuTop.prototype.constructor = myMenuTop;
myMenuTop.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
myMenuTop.prototype.refresh = function() {
this.contents.clear();
};
/////////////////////////////////////////////////////////////////////////////
function myMenuBottom() {
this.initialize.apply(this, arguments);
};
myMenuBottom.prototype = Object.create(Window_Base.prototype);
myMenuBottom.prototype.constructor = myMenuBottom;
myMenuBottom.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
myMenuBottom.prototype.refresh = function() {
this.contents.clear();
};
/////////////////////////////////////////////////////////////////////////////
Window_Base.prototype.drawPicture = function(filename, x, y) {
var bitmap = ImageManager.loadPicture(filename);
this.contents.blt(bitmap, 0, 0, bitmap._canvas.width, bitmap._canvas.height, x, y);
};
/////////////////////////////////////////////////////////////////////////////
Scene_Menu.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createCommandWindow();
this.createGoldWindow();
this.createStatusWindow();
this.createmyMenuStatusWindow();
this.createmyMenuTop();
this.createmyMenuBottom();
};
Scene_Menu.prototype.createmyMenuStatusWindow = function() {
var wx = Graphics.boxWidth - 500
var wy = 0
var ww = 500//Graphics.boxWidth - wx
var wh = Graphics.boxHeight
this._myMenuStatusWindow = new myMenuStatusWindow(wx, wy, ww, wh);
this.addWindow(this._myMenuStatusWindow);
};
Scene_Menu.prototype.createmyMenuTop = function() {
var wx = this._commandWindow.width
var wy = 0
var ww = Graphics.boxWidth - 500 - this._commandWindow.width
var wh = Graphics.boxHeight / 2
this._myMenuTop = new myMenuTop(wx, wy, ww, wh);
this.addWindow(this._myMenuTop);
};
Scene_Menu.prototype.createmyMenuBottom = function() {
var wx = this._commandWindow.width
var wy = Graphics.boxHeight / 2
var ww = Graphics.boxWidth - 500 - this._commandWindow.width
var wh = Graphics.boxHeight / 2
this._myMenuBottom = new myMenuBottom(wx, wy, ww, wh);
this.addWindow(this._myMenuBottom);
};
Window_EquipItem.prototype.setMyWindow = function(myWindow) {
this._myWindow = myWindow;
this.callUpdateHelp();
};
Window_EquipItem.prototype.updateHelp = function() {
Window_ItemList.prototype.updateHelp.call(this);
if (this._actor && this._statusWindow) {
var actor = JsonEx.makeDeepCopy(this._actor);
actor.forceChangeEquip(this._slotId, this.item());
this._statusWindow.setTempActor(actor);
}
if(this._myWindow) {
if(this.item()){
this._myWindow.drawPreviewPicture(0, 0, this._slotId, (this.item()).id);
} else {
this._myWindow.refresh();
}
}
};
function myImageWindow() {
this.initialize.apply(this, arguments);
};
myImageWindow.prototype = Object.create(Window_Base.prototype);
myImageWindow.prototype.constructor = myImageWindow;
myImageWindow.prototype.initialize = function(x, y, width, height) {
Window_Base.prototype.initialize.call(this, x, y, width, height);
this.refresh();
};
myImageWindow.prototype.setActor = function(actor) {
if (this._actor !== actor) {
this._actor = actor;
this.refresh();
}
};
myImageWindow.prototype.setItemId = function(itemId) {
if (this._itemId !== itemId) {
this._itemId = itemId;
this.refresh();
}
};
myImageWindow.prototype.setSlotId = function(slotId) {
if (this._slotId !== slotId) {
this._slotId = slotId;
this.refresh();
}
};
myImageWindow.prototype.refresh = function() {
this.contents.clear();
if (this._actor) {
this.drawImage(0, 0, this._slotId, this._itemId);
}
};
myImageWindow.prototype.drawPreviewPicture = function(x, y, slotId, itemId) {
this.contents.clear();
this.drawImage(x, y, slotId, itemId)
};
myImageWindow.prototype.drawImage = function(x, y, slotId, itemId) {
var actorId = (this._actor).actorId();
switch(slotId) {
case 1:
switch(itemId) {
case 1:
switch(actorId) {
case 1:
this.drawText("ItemId: 1", x, y, 270);
break;
default:
this.drawText("This Actor doesn't have art", x, y, 270);
}
break;
case 2:
switch(actorId) {
case 1:
this.drawText("ItemId: 2", x, y, 270);
break;
default:
this.drawText("This Actor doesn't have art", x, y, 270);
}
break;
case 3:
switch(actorId) {
case 1:
this.drawText("ItemId: 3", x, y, 270);
break;
default:
this.drawText("This Actor doesn't have art", x, y, 270);
}
break;
default:
this.drawText("ItemId: " + itemId, x, y, 270);
}
break;
default:
var myItemId = $gameActors.actor(1).equips()[1].id;
this.drawText("Item Id: " + myItemId, x, y, 270);
}
};
Scene_Equip.prototype.createMyImageWindow = function() {
var wx = Graphics.boxWidth - (Graphics.boxWidth - this._slotWindow.width)
var wy = 0
var ww = Graphics.boxWidth - this._slotWindow.width
var wh = Graphics.boxHeight
this._myImageWindow = new myImageWindow(wx, wy, ww, wh);
this._itemWindow.setMyWindow(this._myImageWindow);
this.addWindow(this._myImageWindow);
};
Scene_Equip.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createHelpWindow();
this.createStatusWindow();
this.createCommandWindow();
this.createSlotWindow();
this.createItemWindow();
this.createMyImageWindow();
this.refreshActor();
};
Scene_Equip.prototype.refreshActor = function() {
var actor = this.actor();
this._statusWindow.setActor(actor);
this._slotWindow.setActor(actor);
this._itemWindow.setActor(actor);
this._myImageWindow.setActor(actor);
};
})();
/////UNUSED RIGHT NOW/////
/*myImageWindow.prototype.optimize = function(slotId, itemId) {
this.contents.clear();
if (this._actor) {
this.drawImage(0, 0, slotId, itemId);
}
};*/