MZ VisuStella ElemStatus Core Elements Category: 4 Columns for elements

Hello all,
I have a little trouble to figure out how to display 4 columns in the element category from the VisuStella ElemStatus Core.
Basically I have to many elements and most are displayed out of the window without any mean to scroll, so I've been tweaking a little and managed to make four collumns but I'm incapable of displaying the elements out of the window on the second and fourth columns.

This is what I have:
help.png


I've seen this post who asked for something similar but in the armors categories, I tried to replicate it but it seems pretty different, at least by my viewpoint.

The question is: what should I change in the code to display the elements out of the window on the second and fourth columns ?

Here is the code so far:

// Declare Constants

const lineHeight = this.lineHeight();
const actor = this._actor;
const padding = this.itemPadding();
const labelFmt = '\\C[16]%1: \\C[0]%2';
const traitType1 = DataManager.traitSetType('Element');
const traitSet1 = actor.traitSet('Element');
const traitType2 = DataManager.traitSetType('SubElement');
const traitSet2 = actor.traitSet('SubElement');
const traitHeight = (this.innerHeight / Math.max(Window_StatusData.traitCol1.length, Window_StatusData.traitCol2.length)) - lineHeight;
let x = 0;
let y = 0;
let width = this.innerWidth / 4;



// Draw Actor Graphic

this.drawActorGraphic(0, width);


// Draw Element Trait Sets

if (traitType1.Visible || traitType2.Visible) {
this.drawItemDarkRect(x, y, width, lineHeight, 2);
this.drawItemDarkRect(width, y, width, lineHeight, 2);
if (traitType1.Visible) {
this.drawTextEx(labelFmt.format(traitType1.Label, traitSet1.Display), padding, y, width - padding * 2);
}
if (traitType2.Visible) {
this.drawTextEx(labelFmt.format(traitType2.Label, traitSet2.Display), width + padding, y, width - padding * 2);
}
y += lineHeight;
this.setDescriptionFontSizeToTraitSet();
this.drawItemDarkRect(x, y, width, traitHeight);
this.drawItemDarkRect(width, y, width, traitHeight);
if (traitType1.Visible) {
this.drawTextEx(traitSet1.Description, padding, y, width - padding * 2);
}
if (traitType2.Visible) {
this.drawTextEx(traitSet2.Description, width + padding, y, width - padding * 2);
}
this.resetDescriptionFontSize();
this.resetFontSettings();
y += traitHeight;
}
const topY = y;

// Prepare Elemental Data

const elementCol1 = this.getElementIDsCol1();
const elementCol2 = this.getElementIDsCol2();
let columnData;
if (elementCol2.length > 0) {
columnData = ['Resist','Resist','Bonus','Bonus'];
} else {
columnData = ['Resist','Bonus'];
}
const dataRows = Math.max(elementCol1.length, elementCol2.length, 1);
const dataCols = columnData.length;

// Draw Elemental Data

this.drawItemDarkRect(width * 0, y, width, lineHeight, 2);
this.drawItemDarkRect(width * 2, y, width, lineHeight, 2);
this.changeTextColor(ColorManager.systemColor());
this.drawText(TextManager.statusMenuDmgReceive, width * 0, y, width, 'center');
this.drawText(TextManager.statusMenuDmgDealt, width * 2, y, width, 'center');
y += lineHeight;
this.setDescriptionFontSizeToTraitSet();
const smallLineHeight = this.textSizeEx(' ').height;

// Draw Elemental Table
for (let i = 0; i < dataRows; i++) {
for (let j = 0; j < dataCols; j++) {

// Draw Dark Rect
const colWidth = this.innerWidth / dataCols;
this.drawItemDarkRect(colWidth * j, y, colWidth, smallLineHeight);

// Draw Element Name
let elementID = elementCol1;
if (dataCols === 4) {
elementID = (j % 2 === 0) ? elementCol1 : elementCol2;
}
if (!elementID) continue;
const name = $dataSystem.elements[elementID];
this.drawTextEx(name, colWidth * (j + 1/3) + padding, y, colWidth*2/3);
const type = columnData[j];

// Draw Resistance Data

this.resetFontSettings();
let drawText = '';
if (type === 'Resist') {
const rate = actor.elementRate(elementID);
const flippedRate = (rate - 1) * -1;
this.changeTextColor(ColorManager.paramchangeTextColor(flippedRate));
drawText = '%1%'.format(Math.round(flippedRate * 100));
if (actor.getAbsorbedElements().includes(elementID)) {
this.changeTextColor(ColorManager.powerUpColor());
drawText = TextManager.statusMenuDmgAbsorb.format(Math.round(rate * 100));
} else if (rate > 1) {
drawText = '%1'.format(drawText);
} else if (rate <= 1) {
drawText = '+%1'.format(drawText);
}



// Draw Bonus Damage Data

} else if (type === 'Bonus') {
const dealtPlus = actor.getDealtElementPlus(elementID);
const dealtRate = actor.getDealtElementRate(elementID);
const dealtFlat = actor.getDealtElementFlat(elementID);
const dealt = ((1 + dealtPlus) * dealtRate + dealtFlat) - 1;
this.changeTextColor(ColorManager.paramchangeTextColor(dealt));
drawText = '%1%'.format(Math.round(dealt * 100));
if (dealt >= 0) drawText = '+%1'.format(drawText);
}



// Draw Value

this.contents.drawText(drawText, colWidth * j, y, (colWidth/3) - padding, smallLineHeight, 'right');
}
y += smallLineHeight;
}



// Closing the Table

for (let j = 0; j < dataCols; j++) {
const colWidth = this.innerWidth / dataCols;
this.drawItemDarkRect(colWidth * j, y, colWidth, this.innerHeight - y);

}


Hoping someone can help, thanks a lot
It already has code to draw 4 columns.

Go to your plugin settings:
-> Status Menu settings
Elements
IDs: Column 1
IDs: Column 2
It already has code to draw 4 columns.

Go to your plugin settings:
-> Status Menu settings
Elements
IDs: Column 1
IDs: Column 2
Hi, thanks for yout answer!

Unfortunately, that's not it, the solution you suggest is just a way to display less elements in the column.
I may have explained badly what I was looking for, I don't want to show less elements, I want to display the elements that are out of the window on a second column to the right of each already existing column (pretty much divide each column by two) and I'm almost sure the only way to do that is through code.

Thanks anyway for your time.
What do you mean less? It displays all you include.

elements.JPG
What do you mean less? It displays all you include.

Okay, I misunderstood what you were saying.

I assumed column 1 was resistances and 2 was damages and the elements in them were a way to make a selection among the elements to be displayed, my stupid bad.

It works as you said, thank you really much !
Ok cool! Solved!

Original thread: https://forums.rpgmakerweb.com/threads/visustella-elemstatus-core-elements-category-4-columns-for-elements.180092/