MZ [VISUMZ MAIN MENU CORE] Help with the "Variable window" feature

I wanted to display the amount of a certain item I have in the database in the main menu like the gold currency. How would I achieve that with the "variable window" feature in the main menu core?
What have you looked at or tried so far?

I've moved this thread to Plugin Support. Thank you.

Step 1, assign a variable to whatever name the item is.. lets say, Potions to variable 1.

Step 2, VisuMZ_1_MainMenuCore > Variable Window > Use Window > true
Variable List > add the variable you assigned as your item (variable 1).
JS: X, Y, W, H >
change the code to this:
Code:
const rows = VisuMZ.MainMenuCore.Settings.Variable.VarList.length;
const ww = this.mainCommandWidth();
const wh = this.calcWindowHeight(rows, false);
const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 0;
let wy = this.mainAreaBottom() - wh;
if (this._goldWindow) wy -= this._goldWindow.height;
// This is where you update the item count to the variable
$gameVariables.setValue(1, $gameParty._items[7]);
// Variable 1 will be set to current amount of item number 7 (Potions)
return new Rectangle(wx, wy, ww, wh);

1666326848047.png


Enjoy!
Step 1, assign a variable to whatever name the item is.. lets say, Potions to variable 1.

Step 2, VisuMZ_1_MainMenuCore > Variable Window > Use Window > true
Variable List > add the variable you assigned as your item (variable 1).
JS: X, Y, W, H >
change the code to this:
Code:
const rows = VisuMZ.MainMenuCore.Settings.Variable.VarList.length;
const ww = this.mainCommandWidth();
const wh = this.calcWindowHeight(rows, false);
const wx = this.isRightInputMode() ? Graphics.boxWidth - ww : 0;
let wy = this.mainAreaBottom() - wh;
if (this._goldWindow) wy -= this._goldWindow.height;
// This is where you update the item count to the variable
$gameVariables.setValue(1, $gameParty._items[7]);
// Variable 1 will be set to current amount of item number 7 (Potions)
return new Rectangle(wx, wy, ww, wh);

View attachment 243091

Enjoy!
Thank you! I'll try this tomorrow. What file do I change the code in?
What have you looked at or tried so far?
I haven't tried anything to be honest. I'm kind of new to rpg maker
Thank you! I'll try this tomorrow. What file do I change the code in?

Hello,

You don't have to open an external file to change this particular code- what he is talking about is a line in your Plugin Settings. Hit F10 and follow his instructions above in the Parameters for your VisuMZ_1_MainMenuCore plugin. All of his instructions in Step 2 are things you change in the Parameters on the right side of the screen. The "code part" is in Variable Window -> JS: X, Y, W, H.

Original thread: https://forums.rpgmakerweb.com/threads/visumz-main-menu-core-help-with-the-variable-window-feature.152108/