Hi everyone,
I have a problem I tried to solve in VS discord but (currently) to no avail. What I'm trying to achieve is to move the experience gauge bar in status menu to a different location (see picture below).
This is what I currently have as plugin parameter 'JS: Draw Data' in Status Menu Categories -> General section of the Elements and Status Menu Core:
There's some redundancy and unused parameters but those I will cull out once I get this working.
Basically I'd like to move the gauge from the Lv 1 to the experience value bar on the right, as shown by the crude arrow. Could someone shed some light on this?
Thanks in advance!
I have a problem I tried to solve in VS discord but (currently) to no avail. What I'm trying to achieve is to move the experience gauge bar in status menu to a different location (see picture below).
This is what I currently have as plugin parameter 'JS: Draw Data' in Status Menu Categories -> General section of the Elements and Status Menu Core:
Code:
// Declare Constants
const maxExp = '-------';
const lineHeight = this.lineHeight();
const gaugeLineHeight = this.gaugeLineHeight();
const basicDataHeight = lineHeight * 6.5;
const actor = this._actor;
const padding = this.itemPadding();
const halfWidth = this.innerWidth / 2;
let rect = new Rectangle(0, 0, halfWidth, this.innerHeight);
let x = 0;
let y = 0;
// Draw Actor Graphic
this.drawActorGraphic(0, this.innerWidth / 2);
// Declare Smaller Data Area
let sx = rect.x;
let sy = Math.max(rect.y, rect.y + (rect.height - basicDataHeight));
let sw = rect.width;
let sh = rect.y + rect.height - sy;
// Draw Actor Name
this.drawItemDarkRect(0, sy, sw, lineHeight, 2);
this.drawText(actor.name(), sx, sy, sw, 'center');
// Draw Actor Icons
sx = rect.x + Math.round((rect.width - 144) / 2);
sy += lineHeight;
this.drawItemDarkRect(0, sy, sw, lineHeight);
this.drawActorIcons(actor, sx, sy);
// Draw Gauges
sx = rect.x + Math.round((rect.width - 128) / 2);
sy += lineHeight;
this.drawItemDarkRect(0, sy, sw, this.innerHeight - sy);
this.placeGauge(actor, "hp", sx, sy);
sy += gaugeLineHeight;
this.placeGauge(actor, "mp", sx, sy);
sy += gaugeLineHeight;
if ($dataSystem.optDisplayTp) {
this.placeGauge(actor, "tp", sx, sy);
}
// Draw Actor Level
sx = rect.x + Math.round((rect.width - 128) / 2);
sy += lineHeight;
this.drawItemDarkRect(0, sy, sw, lineHeight);
this.drawActorLevel(actor, sx, sy);
// Draw Actor Class
const className = actor.currentClass().name;
sx = rect.x + Math.round((rect.width - this.textSizeEx(className).width) / 2);
sy += lineHeight;
this.drawItemDarkRect(0, sy, sw, lineHeight);
this.drawTextEx(className, sx, sy, sw);
// Declare Second Half
rect = new Rectangle(halfWidth, 0, halfWidth, this.innerHeight);
// Draw EXP
// Draw Title Bar
this.changeTextColor(ColorManager.systemColor());
this.drawItemDarkRect(rect.x, rect.y, rect.width, lineHeight, 2);
this.drawText(TextManager.exp, rect.x, rect.y, rect.width, 'center');
const expHeight = lineHeight * 3;
// Draw Experience Texts
this.drawItemDarkRect(rect.x, rect.y + lineHeight * 1, rect.width, lineHeight * 2);
const expTotal = TextManager.expTotal.format(TextManager.exp);
const expNext = TextManager.expNext.format(TextManager.level);
this.changeTextColor(ColorManager.systemColor());
this.drawText(expTotal, rect.x + padding, rect.y + lineHeight * 1, rect.width - padding * 2, 'left');
this.drawText(expNext, rect.x + padding, rect.y + lineHeight * 1, rect.width - padding * 2, 'right');
this.resetTextColor();
// Draw Experience Values
const expTotalValue = actor.currentExp();
const expMissingValue = actor.isMaxLevel() ? maxExp : actor.nextRequiredExp(); //Former expNextValue
const expNextValue = actor.isMaxLevel() ? maxExp : actor.expForLevel(actor._level + 1);
this.drawText(expTotalValue, rect.x + padding, rect.y + lineHeight * 2, rect.width - padding * 2, 'left');
this.drawText('/', rect.x + padding, rect.y + lineHeight * 2, rect.width - padding * 2, 'center');
this.drawText(expNextValue, rect.x + padding, rect.y + lineHeight * 2, rect.width - padding * 2, 'right');
//TEST: Draw Experience Gauge (DOES NOTHING -- ON HOLD FOR NOW)
const gaugeX = rect.x + padding;
const gaugeY = rect.y + lineHeight * 2;
const gaugeRate = actor.currentExp() / actor.nextRequiredExp();
const gaugeColor1 = ColorManager.systemColor();
const gaugeColor2 = ColorManager.systemColor();
this.placeGauge(actor, 'exp', gaugeX, gaugeY);
// Write Actor Biography
y = rect.y + expHeight;
this.changeTextColor(ColorManager.systemColor());
this.drawItemDarkRect(rect.x, y, rect.width, lineHeight, 2);
this.drawText(TextManager.statusMenuBiography, rect.x, y, rect.width, 'center');
this.resetTextColor();
y += lineHeight;
const bioText = actor.getBiography();
this.drawItemDarkRect(rect.x, y, rect.width, this.innerHeight - y);
this.drawTextEx(bioText, rect.x + padding, y, rect.width - padding * 2);
There's some redundancy and unused parameters but those I will cull out once I get this working.
Basically I'd like to move the gauge from the Lv 1 to the experience value bar on the right, as shown by the crude arrow. Could someone shed some light on this?
Thanks in advance!