(function() {
Scene_ItemBase.prototype.showSubWindow = function(window) {
window.x = 140;
window.y = 101;
window.height = 540;
window.show();
window.activate();
};
var _Scene_Menu_create = Scene_Menu.prototype.create;
Scene_Menu.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
// this.createCommandWindow();
_Scene_Menu_create.call(this);
this._statusWindow.x = 140;
this._statusWindow.y = 112;
this._statusWindow.windowWidth = 1000;
this._statusWindow.height = 540;
this._commandWindow.x = 140;
this._commandWindow.y = 4;
// this._commandWindow.width = 1000;
this._commandWindow.height = 99;
this._goldWindow.x = 141;
this._goldWindow.y = 665;
};
Window_MenuStatus.prototype.windowWidth = function(){
return 1000;
};
Window_MenuCommand.prototype.windowWidth = function(){
return 1000;
}
Window_MenuCommand.prototype.maxCols = function() {
return 10;
};
Window_MenuCommand.prototype.numVisibleRows = function() {
return 1;
};
Galv.BM.a = Number(PluginManager.parameters('Galv_BustMenu')["Menu Actors"]);
Galv.BM.ar = Number(PluginManager.parameters('Galv_BustMenu')["Menu Actor Rows"]);
Galv.BM.name = Number(PluginManager.parameters('Galv_BustMenu')["Name"] - 1);
Galv.BM.nickname = Number(PluginManager.parameters('Galv_BustMenu')["Nickname"] - 1);
Galv.BM.class = Number(PluginManager.parameters('Galv_BustMenu')["Class"] - 1);
Galv.BM.level = Number(PluginManager.parameters('Galv_BustMenu')["Level"] - 1);
Galv.BM.bars = Number(PluginManager.parameters('Galv_BustMenu')["Bars"] - 1);
Galv.BM.JP = Number(PluginManager.parameters('Galv_BustMenu')["JP"] - 1);
Galv.BM.SP = Number(PluginManager.parameters('Galv_BustMenu')["SP"] - 1);
Galv.BM.xp = Number(PluginManager.parameters('Galv_BustMenu')["Exp Bar"] - 1);
Galv.BM.xpBar = PluginManager.parameters('Galv_BustMenu')["Show Exp Bar"] == "true" ? true : false;
Galv.BM.xpText = PluginManager.parameters('Galv_BustMenu')["Show Exp Text"] == "true" ? true : false;
Galv.BM.xpLabel = PluginManager.parameters('Galv_BustMenu')["Exp Text"];
Galv.BM.xpHeight = PluginManager.parameters('Galv_BustMenu')["Exp Bar Height"];
Galv.BM.maxTxt = PluginManager.parameters('Galv_BustMenu')["Max Exp Text"];
Galv.BM.xpCol1 = Number(PluginManager.parameters('Galv_BustMenu')["Exp Bar Color 1"]);
Galv.BM.xpCol2 = Number(PluginManager.parameters('Galv_BustMenu')["Exp Bar Color 2"]);
Galv.BM.icons = Number(PluginManager.parameters('Galv_BustMenu')["States"] - 1);
Galv.BM.bust = Number(PluginManager.parameters('Galv_BustMenu')["Bust Y"]);
Galv.BM.bustHeight = Number(PluginManager.parameters('Galv_BustMenu')["Bust Height"]);
Galv.BM.offsets = function() {
var array = PluginManager.parameters('Galv_BustMenu')["Bust Offsets"].split("|");
var obj = {};
for (i = 0; i < array.length; i++) {
if (array[i]) {
var data = array[i].split(",");
obj[data[0]] = [Number(data[1]),Number(data[2])];
};
};
return obj;
}();
//------------------------------------------------------------
// COMPATIBILITY WITH ROCKETMANCER'S PRETTIER GAUGES
if (PluginManager.parameters('PrettyGauges') && Object.keys(PluginManager.parameters('PrettyGauges')).length > 0) {
Galv.BM.rmplugin = true;
};
//------------------------------------------------------------
var Galv_Game_Party_initialize = Game_Party.prototype.initialize;
Game_Party.prototype.initialize = function() {
Galv_Game_Party_initialize.call(this);
this._bustActorCount = Galv.BM.a;
};
// OVERWRITE
Window_MenuStatus.prototype.numVisibleRows = function() {return Galv.BM.ar};
Window_MenuStatus.prototype.maxCols = function() {return $gameParty._bustActorCount};
Window_Selectable.prototype.spacing = function() {return 0};
Window_MenuStatus.prototype.drawItemStatus = function(index) {
var actor = $gameParty.members()[index];
var rect = this.itemRect(index);
var x = rect.x;
var y = rect.y;
var width = rect.width - x - this.textPadding();
this.drawActorSimpleStatus(actor, x, y, width);
};
// OVERWRITE
Window_MenuStatus.prototype.drawActorSimpleStatus = function(actor, x, y, width) {
var lineHeight = this.lineHeight();
var width = this.bustWidth();
var x = x + 5;
var width2 = Math.max(100, width - this.textPadding()) - 5;
if (Galv.BM.xp > -1) this.contents.fontSize = 10; this.drawActorEXP(actor, x+48, 16 + lineHeight * Galv.BM.xp,width2);
if (Galv.BM.name > -1) this.drawActorName(actor, x, y + lineHeight * Galv.BM.name);
if (Galv.BM.nickname > -1) this.drawActorNickname(actor, x, y + lineHeight * Galv.BM.nickname);
if (Galv.BM.level > -1) this.contents.fontSize = 18; this.drawActorLevel(actor, x+135, y + lineHeight * Galv.BM.level);
if (Galv.BM.icons > -1) this.drawActorIcons(actor, x, y + lineHeight * Galv.BM.icons);
if (Galv.BM.class > -1) this.drawActorClass(actor, x, y + lineHeight * Galv.BM.class, width2);
if (Galv.BM.bars > -1) {
this.drawActorHp(actor, x, y + lineHeight * Galv.BM.bars, width2);
this.drawActorMp(actor, x, y + lineHeight * (Galv.BM.bars + 1), width2);
if (Imported.YEP_CoreEngine && eval(Yanfly.Param.MenuTpGauge)) {
this.drawActorTp(actor, x, y + lineHeight * (Galv.BM.bars + 2), width2);
}
};
if (Imported.YEP_JobPoints && eval(Yanfly.Param.JpShowMenu)) {
var classId = actor.currentClass().id;
if (Galv.BM.JP > -1) this.drawActorJp(actor, classId, x+40, y + lineHeight * Galv.BM.JP, width2, 'right');
};
if (Imported.YEP_StatAllocation && eval(Yanfly.Param.StatAlcAPMenu)) {
if (Galv.BM.SP > -1) this.drawActorAp(actor, x+3, y + lineHeight * Galv.BM.SP, width2, 'left');
};
};
Game_Actor.prototype.xpRate = function() {
return 1 - (this.nextLevelExp() - this.currentExp()) / (this.nextLevelExp() - this.currentLevelExp());
};
Window_MenuStatus.prototype.drawActorEXP = function(actor, x, y, width) {
if (Galv.BM.xpBar) {
var color1 = this.xpGaugeColor1();
var color2 = this.xpGaugeColor2();
if (actor.isMaxLevel()) {
var xprate = 100;
} else {
var xprate = actor.xpRate();
};
this.drawExpGauge(x-8, y-12, 152, xprate, color1, color2);
};
if (Galv.BM.xpText) {
this.changeTextColor(this.systemColor());
this.drawText(xprate < 100 ? Galv.BM.xpLabel : Galv.BM.maxTxt, x, y, 44);
this.changeTextColor(this.normalColor());
if (xprate < 100) this.drawText(actor.nextRequiredExp(), x, y, width,"left");
};
};
if (Galv.BM.rmplugin) {
// IF ROCKETMANCER'S PRETTIER GAUGES PLUGIN
var parameters = PluginManager.parameters('PrettyGauges');
var barTypeLeft = String(parameters['barType']).substring(0,1);
var barTypeRight = String(parameters['barType']).substring(1,2)
var outline = Number(parameters['outline'] || 0);
var barHeight = Number(parameters['barHeight'] || 0);
var outlineColor1 = String(parameters['outlineColor1']);
var outlineColor2 = String(parameters['outlineColor2']);
var backgroundColor1 = String(parameters['backgroundColor1']);
var backgroundColor2 = String(parameters['backgroundColor2']);
var hpColor1 = String(parameters['hpColor1']);
var hpColor2 = String(parameters['hpColor2']);
var mpColor1 = String(parameters['mpColor1']);
var mpColor2 = String(parameters['mpColor2']);
var tpColor1 = String(parameters['tpColor1']);
var tpColor2 = String(parameters['tpColor2']);
Window_Base.prototype.drawExpGauge = function(x, y, width, rate, color1, color2) {
var fillW = Math.floor(rate * width);
var gaugeY = y + this.lineHeight() - 2 - barHeight;
this.contents.fillTrap(x, gaugeY, width, width, barHeight, this.gaugeBackColor1(), this.gaugeBackColor2());
this.contents.fillTrap(x, gaugeY, width, fillW, barHeight, color1, color2);
};
} else {
// IF GALV ONLY
Window_Base.prototype.drawExpGauge = function(dx, dy, dw, rate, color1, color2) {
var color3 = this.gaugeBackColor();
var fillW = Math.floor(dw * rate).clamp(0, dw);
var gaugeH = Galv.BM.xpHeight;
var gaugeY = dy + this.lineHeight() - gaugeH - 2;
var fillW = Math.floor(dw * rate);
var gaugeY = dy + this.lineHeight() - gaugeH - 2;
this.contents.fillRect(dx, gaugeY, dw, gaugeH, color3);
this.contents.gradientFillRect(dx, gaugeY, dw - fillW, gaugeH, color1, color2);
};
};
Window_Base.prototype.xpGaugeColor1 = function() {
return this.textColor(Galv.BM.xpCol1);
};
Window_Base.prototype.xpGaugeColor2 = function() {
return this.textColor(Galv.BM.xpCol2);
};
// Because blt didn't let you draw a bitmap if it was a tiny bit off
Bitmap.prototype.unlimitedBlt = function(source, sx, sy, sw, sh, dx, dy, dw, dh) {
dw = dw || sw;
dh = dh || sh;
this._context.globalCompositeOperation = 'source-over';
this._context.drawImage(source._canvas, sx, sy, sw, sh, dx, dy, dw, dh);
this._setDirty();
};
Window_MenuStatus.prototype.drawFace = function(faceName, faceIndex, x, y, width, height) {
var width = this.bustWidth();
var bustName = faceName + "_" + (faceIndex + 1)
var bitmap = ImageManager.loadPicture(bustName);
var ox = 0;
var oy = 0;
if (Galv.BM.offsets[bustName]) {
ox = Galv.BM.offsets[bustName][0] || 0;
oy = Galv.BM.offsets[bustName][1] || 0;
};
var sw = width;
var sh = Galv.BM.bustHeight;
var dx = x - 1;
var dy = y + Galv.BM.bust;
var sx = bitmap.width / 2 - width / 2 - ox;
var sy = oy;
this.contents.unlimitedBlt(bitmap, sx, sy, sw, sh, dx, dy);
};
Window_MenuStatus.prototype.bustWidth = function() {
return Math.floor((this.width - (this.standardPadding() * 2)) / this.maxCols());
};
Window_MenuStatus.prototype.cursorDown = function(wrap) {
var index = this.index();
var maxItems = this.maxItems();
var maxCols = this.maxCols();
if (index < maxItems - maxCols || (wrap && maxCols === 1)) {
this.select((index + maxCols) % maxItems);
} else {
this.select(maxItems - 1);
}
};
Window_MenuStatus.prototype.cursorUp = function(wrap) {
var index = this.index();
var maxItems = this.maxItems();
var maxCols = this.maxCols();
if (index >= maxCols || (wrap && maxCols === 1)) {
this.select((index - maxCols + maxItems) % maxItems);
} else {
this.select(0);
}
};
})();