Menu is looking great except the current parameters are misplaced and merging with the parameter names, not sure how to move them more to the right, it's obviously somewhere in the Window_StatCompare section in the code but I've tried changing everything seemingly relevant to the positioning of the text and I can't figure it out for the life of me. Edit: Forgot to put this but I have reduced the screen size to be 480 x 432 using Yanfly, 3x more than the Game Boy screen size
(The blank parameter (which is MDF) is meant to be blank, was gonna sort it out later, seems easy but if you know how to get rid of it feel free to tell me 😛)
What's interesting is that when I turn off Eli_BitmapFontPro, the current parameters set in the right position, but of course the font not being bitmapped makes it look a bit shiiiiiiiit
Stat Compare window of code
(The blank parameter (which is MDF) is meant to be blank, was gonna sort it out later, seems easy but if you know how to get rid of it feel free to tell me 😛)
What's interesting is that when I turn off Eli_BitmapFontPro, the current parameters set in the right position, but of course the font not being bitmapped makes it look a bit shiiiiiiiit
Stat Compare window of code
//=============================================================================
// Window_StatCompare
//=============================================================================
function Window_StatCompare() {
this.initialize.apply(this, arguments);
}
Window_StatCompare.prototype = Object.create(Window_Base.prototype);
Window_StatCompare.prototype.constructor = Window_StatCompare;
Window_StatCompare.prototype.initialize = function(wx, wy, ww, wh) {
Window_Base.prototype.initialize.call(this, wx, wy, ww, wh);
this._actor = null;
this._tempActor = null;
this.refresh();
};
Window_StatCompare.prototype.createWidths = function() {
this._paramNameWidth = 0;
this._paramValueWidth = 0;
this._arrowWidth = this.textWidth('\u2192' + ' ');
var buffer = this.textWidth(' ');
for (var i = 0; i < 8; ++i) {
var value1 = this.textWidth(TextManager.param(i));
var value2 = this.textWidth(Yanfly.Util.toGroup(this._actor.paramMax(i)));
this._paramNameWidth = Math.max(value1, this._paramNameWidth);
this._paramValueWidth = Math.max(value2, this._paramValueWidth);
}
this._bonusValueWidth = this._paramValueWidth;
this._bonusValueWidth += this.textWidth('(+)') + buffer;
this._paramNameWidth += buffer;
this._paramValueWidth;
if (this._paramNameWidth + this._paramValueWidth * 2 + this._arrowWidth +
this._bonusValueWidth > this.contents.width) this._bonusValueWidth = 0;
};
Window_StatCompare.prototype.setActor = function(actor) {
if (this._actor === actor) return;
this._actor = actor;
this.createWidths();
this.refresh();
};
Window_StatCompare.prototype.refresh = function() {
this.contents.clear();
if (!this._actor) return;
for (var i = 0; i < 8; ++i) {
this.drawItem(0, this.lineHeight() * i, i);
}
};
Window_StatCompare.prototype.setTempActor = function(tempActor) {
if (this._tempActor === tempActor) return;
this._tempActor = tempActor;
this.refresh();
};
Window_StatCompare.prototype.drawItem = function(x, y, paramId) {
this.drawDarkRect(x, y, this.contents.width, this.lineHeight());
this.drawParamName(y, paramId);
this.drawCurrentParam(y, paramId);
this.drawRightArrow(y);
if (!this._tempActor) return;
this.drawNewParam(y, paramId);
this.drawParamDifference(y, paramId);
};
//Dark Rectangle Controler
Window_StatCompare.prototype.drawDarkRect = function(dx, dy, dw, dh) {
var color = this.systemColor();
this.changePaintOpacity(false);
this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
this.changePaintOpacity(true);
};
Window_StatCompare.prototype.drawParamName = function(y, paramId) {
var x = this.textPadding();
this.changeTextColor(this.systemColor());
this.drawText(TextManager.param(paramId), x, y, this._paramNameWidth);
};
Window_StatCompare.prototype.drawCurrentParam = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._paramValueWidth * 2 + this._arrowWidth + this._bonusValueWidth;
this.resetTextColor();
var actorparam = Yanfly.Util.toGroup(this._actor.param(paramId));
this.drawText(actorparam, x, y, this._paramValueWidth, 'right');
};
Window_StatCompare.prototype.drawRightArrow = function(y) {
var x = this.contents.width - this.textPadding();
x -= this._paramValueWidth + this._arrowWidth + this._bonusValueWidth;
var dw = this.textWidth('\u2192' + ' ');
this.changeTextColor(this.systemColor());
this.drawText('\u2192', x, y, dw, 'center');
};
Window_StatCompare.prototype.drawNewParam = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._paramValueWidth + this._bonusValueWidth;
var newValue = this._tempActor.param(paramId);
var diffvalue = newValue - this._actor.param(paramId);
var actorparam = Yanfly.Util.toGroup(newValue);
this.changeTextColor(this.paramchangeTextColor(diffvalue));
this.drawText(actorparam, x, y, this._paramValueWidth, 'right');
};
Window_StatCompare.prototype.drawParamDifference = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._bonusValueWidth;
var newValue = this._tempActor.param(paramId);
var diffvalue = newValue - this._actor.param(paramId);
if (diffvalue === 0) return;
var actorparam = Yanfly.Util.toGroup(newValue);
this.changeTextColor(this.paramchangeTextColor(diffvalue));
var text = Yanfly.Util.toGroup(diffvalue);
if (diffvalue > 0) {
text = ' (+' + text + ')';
} else {
text = ' (' + text + ')';
}
this.drawText(text, x, y, this._bonusValueWidth, 'left');
};
// Window_StatCompare
//=============================================================================
function Window_StatCompare() {
this.initialize.apply(this, arguments);
}
Window_StatCompare.prototype = Object.create(Window_Base.prototype);
Window_StatCompare.prototype.constructor = Window_StatCompare;
Window_StatCompare.prototype.initialize = function(wx, wy, ww, wh) {
Window_Base.prototype.initialize.call(this, wx, wy, ww, wh);
this._actor = null;
this._tempActor = null;
this.refresh();
};
Window_StatCompare.prototype.createWidths = function() {
this._paramNameWidth = 0;
this._paramValueWidth = 0;
this._arrowWidth = this.textWidth('\u2192' + ' ');
var buffer = this.textWidth(' ');
for (var i = 0; i < 8; ++i) {
var value1 = this.textWidth(TextManager.param(i));
var value2 = this.textWidth(Yanfly.Util.toGroup(this._actor.paramMax(i)));
this._paramNameWidth = Math.max(value1, this._paramNameWidth);
this._paramValueWidth = Math.max(value2, this._paramValueWidth);
}
this._bonusValueWidth = this._paramValueWidth;
this._bonusValueWidth += this.textWidth('(+)') + buffer;
this._paramNameWidth += buffer;
this._paramValueWidth;
if (this._paramNameWidth + this._paramValueWidth * 2 + this._arrowWidth +
this._bonusValueWidth > this.contents.width) this._bonusValueWidth = 0;
};
Window_StatCompare.prototype.setActor = function(actor) {
if (this._actor === actor) return;
this._actor = actor;
this.createWidths();
this.refresh();
};
Window_StatCompare.prototype.refresh = function() {
this.contents.clear();
if (!this._actor) return;
for (var i = 0; i < 8; ++i) {
this.drawItem(0, this.lineHeight() * i, i);
}
};
Window_StatCompare.prototype.setTempActor = function(tempActor) {
if (this._tempActor === tempActor) return;
this._tempActor = tempActor;
this.refresh();
};
Window_StatCompare.prototype.drawItem = function(x, y, paramId) {
this.drawDarkRect(x, y, this.contents.width, this.lineHeight());
this.drawParamName(y, paramId);
this.drawCurrentParam(y, paramId);
this.drawRightArrow(y);
if (!this._tempActor) return;
this.drawNewParam(y, paramId);
this.drawParamDifference(y, paramId);
};
//Dark Rectangle Controler
Window_StatCompare.prototype.drawDarkRect = function(dx, dy, dw, dh) {
var color = this.systemColor();
this.changePaintOpacity(false);
this.contents.fillRect(dx + 1, dy + 1, dw - 2, dh - 2, color);
this.changePaintOpacity(true);
};
Window_StatCompare.prototype.drawParamName = function(y, paramId) {
var x = this.textPadding();
this.changeTextColor(this.systemColor());
this.drawText(TextManager.param(paramId), x, y, this._paramNameWidth);
};
Window_StatCompare.prototype.drawCurrentParam = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._paramValueWidth * 2 + this._arrowWidth + this._bonusValueWidth;
this.resetTextColor();
var actorparam = Yanfly.Util.toGroup(this._actor.param(paramId));
this.drawText(actorparam, x, y, this._paramValueWidth, 'right');
};
Window_StatCompare.prototype.drawRightArrow = function(y) {
var x = this.contents.width - this.textPadding();
x -= this._paramValueWidth + this._arrowWidth + this._bonusValueWidth;
var dw = this.textWidth('\u2192' + ' ');
this.changeTextColor(this.systemColor());
this.drawText('\u2192', x, y, dw, 'center');
};
Window_StatCompare.prototype.drawNewParam = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._paramValueWidth + this._bonusValueWidth;
var newValue = this._tempActor.param(paramId);
var diffvalue = newValue - this._actor.param(paramId);
var actorparam = Yanfly.Util.toGroup(newValue);
this.changeTextColor(this.paramchangeTextColor(diffvalue));
this.drawText(actorparam, x, y, this._paramValueWidth, 'right');
};
Window_StatCompare.prototype.drawParamDifference = function(y, paramId) {
var x = this.contents.width - this.textPadding();
x -= this._bonusValueWidth;
var newValue = this._tempActor.param(paramId);
var diffvalue = newValue - this._actor.param(paramId);
if (diffvalue === 0) return;
var actorparam = Yanfly.Util.toGroup(newValue);
this.changeTextColor(this.paramchangeTextColor(diffvalue));
var text = Yanfly.Util.toGroup(diffvalue);
if (diffvalue > 0) {
text = ' (+' + text + ')';
} else {
text = ' (' + text + ')';
}
this.drawText(text, x, y, this._bonusValueWidth, 'left');
};