Good morning, afternoon, evening.
I request your assistance once more.
Is it possible to code a snippet that shows an icon for lower and higher stat comparision instead of the traditional
arrow?
If possible it should be compatible with Yanfly's Equip Core but could also work with the default equip menu.
Similar to this, it could display an icon with an arrow up to show a stat getting raised, and another icon to show a stat getting lowered.
(function() {
var _Window_StatCompare_drawParamName = Window_StatCompare.prototype.drawParamName;
Window_StatCompare.prototype.drawParamName = function(item, x, y) {
_Window_StatCompare_drawParamName.call(this, item, x, y);
this.drawParamIcon(item, x, y);
};
Window_StatCompare.prototype.drawParamIcon = function(item, x, y) {
var currentValue = this._actor.param(item);
var newItem = this._tempActor ? this._tempActor.equips()[this._slotId] : null;
var newValue = newItem ? newItem.params[item] : currentValue;
var iconDown = 23; // Replace with the icon ID for lowered stats
var iconUp = 24; // Replace with the icon ID for raised stats
var iconId = 0;
if (currentValue < newValue) {
iconId = iconUp;
} else if (currentValue > newValue) {
iconId = iconDown;
}
if (iconId > 0) {
var iconWidth = Window_Base._iconWidth;
var iconHeight = Window_Base._iconHeight;
this.drawIcon(iconId, x + this.textWidth(' '), y + this.lineHeight() - iconHeight);
}
};
})();
I tried coding this myself but this gave me a type error
Any help is appreciated.
I request your assistance once more.
Is it possible to code a snippet that shows an icon for lower and higher stat comparision instead of the traditional
arrow?
If possible it should be compatible with Yanfly's Equip Core but could also work with the default equip menu.
Similar to this, it could display an icon with an arrow up to show a stat getting raised, and another icon to show a stat getting lowered.
(function() {
var _Window_StatCompare_drawParamName = Window_StatCompare.prototype.drawParamName;
Window_StatCompare.prototype.drawParamName = function(item, x, y) {
_Window_StatCompare_drawParamName.call(this, item, x, y);
this.drawParamIcon(item, x, y);
};
Window_StatCompare.prototype.drawParamIcon = function(item, x, y) {
var currentValue = this._actor.param(item);
var newItem = this._tempActor ? this._tempActor.equips()[this._slotId] : null;
var newValue = newItem ? newItem.params[item] : currentValue;
var iconDown = 23; // Replace with the icon ID for lowered stats
var iconUp = 24; // Replace with the icon ID for raised stats
var iconId = 0;
if (currentValue < newValue) {
iconId = iconUp;
} else if (currentValue > newValue) {
iconId = iconDown;
}
if (iconId > 0) {
var iconWidth = Window_Base._iconWidth;
var iconHeight = Window_Base._iconHeight;
this.drawIcon(iconId, x + this.textWidth(' '), y + this.lineHeight() - iconHeight);
}
};
})();
I tried coding this myself but this gave me a type error
Any help is appreciated.