MZ Offset menu column

Hello guys,
I have a small big problem my parameters are offset see pictures. by one and I can't out where to fix it? The coloring windows are offset by 1 and leaving out the HP parameter.
It is probably somewhere in the VisustellaMZ-Equip-Core without it, it looks fine.
Is it possible the offset is in correlation to the fact that my character portraits are missing?
Thank you very much in advance.
can you reword what it is you're looking to do? I cant quite understand what it is.
@NaosoX I had a hard time figuring it out, too. It doesn't help that the first screenshot doesn't seem to have anything to do with it.

It's the left column, with the names of the parameters. The color changes to green/brown are one row too low - Max HP is going down, but it's still white, whereas Max ST is turned brown but it's going up.

The colors on the parameter names should match the colors of the +/- values all the way to the right.

Between that and portraits missing, something definitely seems bollocksed up in the plugin. I'd make sure you have the latest version, uninstall and reinstall it, make sure it's in the correct order to any other plugins you have.
yea, looks like the change in color leaks onto the next line.
when in doubt, start fresh!
Spoiler: peek-a-boo
1694091235709.png
@ATT_Turan you rephrased it good, though the first picture shows that, in there the first line isn't colored blue like the others already.
I couldn't find a way to get this right in the VisuStella Plugin. In their own projects it doesn't matter, because they used the core engine to put another color over the first column. I don't use it because it really slows down the game and I often use a 100 parallel processes on maps.
My solution is now to use the old design. That way it is shown correctly even if not that pretty.
@ATT_Turan you rephrased it good, though the first picture shows that, in there the first line isn't colored blue like the others already.
Ah, I didn't notice that.

I'm not familiar with this plugin - I know some of them provide plugin parameters containing the JavaScript for the menu formatting, so if you have access to that you could copy it over and see if there's an error.
Thank you for your time.
Actually I am quite fine with my solution for now (see attachments) even though I am still wondering why it is that way.
Below are the functions in the Plugin
Though since the Visustella Plugins are encrypted that is not all code there is.

Code:
Window:

// Declare Variables


const lineHeight = this.lineHeight();


const padding = this.itemPadding();


const x1 = padding;


const x2 = this.innerWidth - 128 - padding;




// Draw Menu Image


this.drawItemActorMenuImage(this._actor, 0, 0, this.innerWidth, this.innerHeight);




// Draw Data


this.drawActorName(this._actor, x1, lineHeight * 0);


this.drawActorClass(this._actor, x1, lineHeight * 1);


this.drawActorIcons(this._actor, x1, lineHeight * 2);


this.drawActorLevel(this._actor, x2, lineHeight * 0);


this.placeBasicGauges(this._actor, x2, lineHeight * 1);




Draw Equip Data

// Set Variables


const lineHeight = this.lineHeight();


const paramheight = this.gaugeLineHeight() + 8;


let x = 0;


let y = 0;


let width = this.innerWidth;


let height = this.innerHeight;


let hw = Math.floor(width / 2);


let hx = x + width - hw;




// Draw Item Name, Type, and Quantity


this.drawItemName(this._item, x + this.itemPadding(), y, width - this.itemPadding() * 2);


this.drawItemDarkRect(x, y, width);


y += lineHeight;


if (this.drawItemEquipType(x, y, hw)) y += 0;


if (this.drawItemQuantity(hx, y, hw)) y += lineHeight;




// Draw Parameter Names


const params = this.actorParams();


const backY = y;


y = height - (params.length * paramheight) - 4;


let paramX = x;


let paramWidth = 0;


let tableY = y;


for (const paramId of params) {


paramWidth = Math.max(this.drawParamName(paramId, x + 4, y + 4, width), paramWidth);


y += paramheight;


}




// Draw Actor Data


const actorMax = $gameParty.maxBattleMembers();


const actorWidth = Math.floor((width - paramWidth) / actorMax);


paramWidth = width - (actorWidth * actorMax);


for (const actor of $gameParty.battleMembers()) {


const index = $gameParty.battleMembers().indexOf(actor);


const actorX = paramX + paramWidth + (index * actorWidth);


this.changePaintOpacity(actor.canEquip(this._item));


this.drawActorCharacter(actor, actorX + (actorWidth / 2), tableY);


let actorY = tableY;




// Draw Parameter Changes


for (const paramId of params) {


const diffY = actorY - ((lineHeight - paramheight) / 2);


this.drawActorParamDifference(actor, paramId, actorX, diffY, actorWidth);


actorY += paramheight;


}


}




// Draw Back Rectangles


this.drawItemDarkRect(paramX, backY, paramWidth, tableY - backY);


for (let i = 0; i < actorMax; i++) {


const actorX = paramX + paramWidth + (i * actorWidth);


this.drawItemDarkRect(actorX, backY, actorWidth, tableY - backY);


}


for (const paramId of params) {


this.drawItemDarkRect(paramX, tableY, paramWidth, paramheight);


for (let i = 0; i < actorMax; i++) {


const actorX = paramX + paramWidth + (i * actorWidth);


this.drawItemDarkRect(actorX, tableY, actorWidth, paramheight);


}


tableY += paramheight;


}
Just as a tip, any time you post code you should use the CODE tags (the </> in the edit bar). That preserves indentations and brackets.

My bet, from looking at that code, is exactly what @NaosoX said - that the color change in drawActorParamDifference() is leaking over to the next line. I don't think the parameter names are supposed to be different colors at all.

I'd suggest trying the following change:
Code:
for (const paramId of params) {
    this.changeTextColor(ColorManager.systemColor());
    paramWidth = Math.max(this.drawParamName(paramId, x + 4, y + 4, width), paramWidth);

see if that resets it correctly.

If not, you might want to submit a bug report to VisuStella, as it seems the error might be in drawActorParamDifference(), which is a function made in the plugin.
@ATT_Turan Thank you for your help. For some reason I get the error "unexpected token ')' "
I sent a bug report to VisuStella weeks ago...
@ATT_Turan Thank you for your help. For some reason I get the error "unexpected token ')' "
I sent a bug report to VisuStella weeks ago...
Did you paste in the one line in between the two other lines that I showed for reference? You were not supposed to copy all three of those lines and randomly plop them at the bottom of your plugin parameter 😉
is this what you're looking for?
Parameter name color changing with parameter value?
1694096304771.png

1694096333859.png
@ATT_Turan You're right I did something wrong. I tried again, but the problem still stays the same as before.
My release is tomorrow, I think I will look at this problem next week again. I totally forget about this visual bug and I guess, my solution with going back to the default style has to suffice for now XD
@NaosoX Yes, exactly.
Plop the attached file into your plugins...
then navigate to your plugin manager
VisuMZ_1_ItemsEquipsCore > Equip Menu Settings > JS: Parameter Lower >
Spoiler: Replace Code
1694101333895.png

Code:
// Declare variables
const params = this.actorParams();
const lineHeight = this.lineHeight();
const padding = this.itemPadding();
const baseX = 0;
const baseY = this.innerHeight - params.length * lineHeight;
const baseWidth = this.innerWidth;
const valueFontSize = this.paramValueFontSize();

// Calculate Widths
let paramNameWidth = Math.max(...params.map(param => this.textWidth(TextManager.param(param))));
paramNameWidth += padding * 2;
if (this.isUseParamNamesWithIcons()) {
    paramNameWidth += ImageManager.iconWidth + 4;
}
let arrowWidth = this.rightArrowWidth();
const totalDivides = this.innerWidth >= 500 ? 3 : 2;
let paramValueWidth = Math.floor((baseWidth - paramNameWidth - arrowWidth) / totalDivides);
paramNameWidth = baseWidth - (paramValueWidth * totalDivides) - arrowWidth;

// Draw Parameters
let x = baseX;
let y = baseY;
let value = 0;
let diffValue = 0;
let alter = 2;
for (const paramId of params) {
    // Naoso was here
    // Draw Param Name Rect
    this.drawItemDarkRect(x, y, paramNameWidth, lineHeight, alter);
    x += paramNameWidth;

    // Draw Param Before
    this.contents.fontSize = valueFontSize;
    this.drawItemDarkRect(x, y, paramValueWidth, lineHeight, alter);
    this.drawUpdatedBeforeParamValue(paramId, x, y, paramValueWidth);
    this.resetFontSettings();
    x += paramValueWidth;

    // Draw Arrow
    this.drawItemDarkRect(x, y, arrowWidth, lineHeight, alter);
    this.drawRightArrow(x, y);
    x += arrowWidth;

    // Draw Param After
    this.contents.fontSize = valueFontSize;
    this.drawItemDarkRect(x, y, paramValueWidth, lineHeight, alter);
    this.drawUpdatedAfterParamValue(paramId, x, y, paramValueWidth);
    x += paramValueWidth;

    // Draw Param Change
    if (totalDivides > 2) {
        this.drawItemDarkRect(x, y, paramValueWidth, lineHeight, alter);
        this.drawUpdatedParamValueDiff(paramId, x, y, paramValueWidth);
    }

    // Draw Param Name
    x = baseX;
    this.drawUpdatedParamName(paramId, x, y, paramNameWidth);
    this.resetFontSettings();

    // Prepare Next Parameter
    x = baseX;
    y += lineHeight;
    alter = alter === 2 ? 1 : 2;
}
Spoiler: Replace Code(Icon Version)
1694101221708.png

Code:
// Declare variables
const params = this.actorParams();
const lineHeight = this.lineHeight();
const padding = this.itemPadding();
const baseX = 0;
const baseY = this.innerHeight - params.length * lineHeight;
const baseWidth = this.innerWidth;
const valueFontSize = this.paramValueFontSize();

// Calculate Widths
let paramNameWidth = Math.max(...params.map(param => this.textWidth(TextManager.param(param))));
paramNameWidth += padding * 2;
if (this.isUseParamNamesWithIcons()) {
    paramNameWidth += ImageManager.iconWidth + 4;
}
let arrowWidth = this.rightArrowWidth();
const totalDivides = this.innerWidth >= 500 ? 3 : 2;
let paramValueWidth = Math.floor((baseWidth - paramNameWidth - arrowWidth) / totalDivides);
paramNameWidth = baseWidth - (paramValueWidth * totalDivides) - arrowWidth;

// Draw Parameters
let x = baseX;
let y = baseY;
let value = 0;
let diffValue = 0;
let alter = 2;
let paramNum = 0;
let paramIcon = [
    VisuMZ.CoreEngine.Settings.Param.IconParam0,
    VisuMZ.CoreEngine.Settings.Param.IconParam1,
    VisuMZ.CoreEngine.Settings.Param.IconParam2,
    VisuMZ.CoreEngine.Settings.Param.IconParam3,
    VisuMZ.CoreEngine.Settings.Param.IconParam4,
    VisuMZ.CoreEngine.Settings.Param.IconParam5,
    VisuMZ.CoreEngine.Settings.Param.IconParam6,
    VisuMZ.CoreEngine.Settings.Param.IconParam7
];
for (const paramId of params) {
    // Naoso was here
    // Draw Param Name Rect
    this.drawItemDarkRect(x, y, paramNameWidth, lineHeight, alter);
    x += paramNameWidth;

    // Draw Param Before
    this.contents.fontSize = valueFontSize;
    this.drawItemDarkRect(x, y, paramValueWidth, lineHeight, alter);
    this.drawUpdatedBeforeParamValue(paramId, x, y, paramValueWidth);
    this.resetFontSettings();
    x += paramValueWidth;

    // Draw Arrow
    this.drawItemDarkRect(x, y, arrowWidth, lineHeight, alter);
    this.drawRightArrow(x, y);
    x += arrowWidth;

    // Draw Param After
    this.contents.fontSize = valueFontSize;
    this.drawItemDarkRect(x, y, paramValueWidth, lineHeight, alter);
    this.drawUpdatedAfterParamValue(paramId, x, y, paramValueWidth);
    x += paramValueWidth;

    // Draw Param Change
    if (totalDivides > 2) {
        this.drawItemDarkRect(x, y, paramValueWidth, lineHeight, alter);
        this.drawUpdatedParamValueDiff(paramId, x, y, paramValueWidth);
    }

    // Draw Param Icon
    x = baseX;
    this.drawIcon(paramIcon[paramNum], x, y)
    x += padding * 2 + 16;
    // Draw Param Name
    this.drawUpdatedParamName(paramId, x, y, paramNameWidth);
    paramNum++;
    this.resetFontSettings();

    // Prepare Next Parameter
    x = baseX;
    y += lineHeight;
    alter = alter === 2 ? 1 : 2;
}

Enjoy!
@NaosoX Wow, must be nice to know how to code, when designing a game :-D
Thank you very much!!!
@NaosoX Wow, must be nice to know how to code, when designing a game :-D
Thank you very much!!!
The more you practice and make mistakes, the more you learn.
Let's just say I've made a lot of mistakes.

I've included a version that still includes the Icons for anyone who wants that.
@NaosoX I am sorry to bother you again, but do you have an idea, why only in the equip menu the faces are not shown? The box is just empty. I use faces everywhere in the menu and everywhere else they appear.
Code:
// Declare Variables
const lineHeight = this.lineHeight();
const gaugeLineHeight = this.gaugeLineHeight();
const x = Math.floor(this.innerWidth / 2);
const limitHeight = this.innerHeight - (this.actorParams().length * lineHeight);
const actorX = Math.floor((x - ImageManager.faceWidth) / 2);
const actorY = Math.floor((limitHeight - ImageManager.faceHeight) / 2);
let dataHeight = lineHeight * 3;
dataHeight += gaugeLineHeight * ($dataSystem.optDisplayTp ? 3 : 2);
const dataY = Math.floor((limitHeight - dataHeight) / 2);
@NaosoX I am sorry to bother you again, but do you have an idea, why only in the equip menu the faces are not shown? The box is just empty. I use faces everywhere in the menu and everywhere else they appear.
Code:
// Declare Variables
const lineHeight = this.lineHeight();
const gaugeLineHeight = this.gaugeLineHeight();
const x = Math.floor(this.innerWidth / 2);
const limitHeight = this.innerHeight - (this.actorParams().length * lineHeight);
const actorX = Math.floor((x - ImageManager.faceWidth) / 2);
const actorY = Math.floor((limitHeight - ImageManager.faceHeight) / 2);
let dataHeight = lineHeight * 3;
dataHeight += gaugeLineHeight * ($dataSystem.optDisplayTp ? 3 : 2);
const dataY = Math.floor((limitHeight - dataHeight) / 2);
If thats what you have in the JS: Face Upper section, you may just be missing the part of the code that actually draws the face.

This is the default code:
Code:
// Declare Variables
const lineHeight = this.lineHeight();
const gaugeLineHeight = this.gaugeLineHeight();
const x = Math.floor(this.innerWidth / 2);
const limitHeight = this.innerHeight - (this.actorParams().length * lineHeight);
const actorX = Math.floor((x - ImageManager.faceWidth) / 2);
const actorY = Math.floor((limitHeight - ImageManager.faceHeight) / 2);
let dataHeight = lineHeight * 3;
dataHeight += gaugeLineHeight * ($dataSystem.optDisplayTp ? 3 : 2);
const dataY = Math.floor((limitHeight - dataHeight) / 2);

// Draw Data
this.drawActorFace(this._actor, actorX, actorY, ImageManager.faceWidth, ImageManager.faceHeight);
this.drawActorIcons(this._actor, actorX + 16, actorY + ImageManager.faceHeight - lineHeight);
this.drawActorName(this._actor, x, dataY + lineHeight * 0);
this.drawActorLevel(this._actor, x, dataY + lineHeight * 1);
this.drawActorClass(this._actor, x, dataY + lineHeight * 2);
this.placeBasicGauges(this._actor, x, dataY + lineHeight * 3);

For future reference, when your original post has been satisfied, it's better to start a new thread when changing topics.
@NaosoX You're a lifesaver. If you'd like a free key to my game just PM me.
I could have probably found that in an older file, but I am too stupid. In the last days I am totally out of it.

Original thread: https://forums.rpgmakerweb.com/threads/offset-menu-column.160954/