MV Help with Yanfly's Item Upgrade Slots Plugin

Hi guys,

Hope everyone is doing well.

I have a little issue with Yanfly's Item Upgrade Slots and the way how are the upgrades displayed in the window.
As you can see in the picture when used together with Augments, some parts are being drawn off the screen.

My question is: Is it possible to draw the the Upgrades next to each other instead off underneath each other (see picture).

I guess it would mean to alter the code in the plugin itself but I have rather limited Java Script knowledge so I wouldn't feel confident diving into this...

Any help is much appreciated.

Thank you




Screenshot.png
What is your game window's dimensions?
What is your game window's dimensions?
Hi Turan,

The game resolution is currently set to 1200 x 624
Well, the easy first option would be to increase the vertical size of your game window (which is different from resolution. Resolution refers to pixels per area).

If you strongly don't want to do that, you can try this (I've not tested it).

Open the Upgrade Slots plugin, go to line 1038 and change it to this:
Code:
      if (!i % 2) dx += this.textWidth(text) + 10; else dy += this.lineHeight();
Well, the easy first option would be to increase the vertical size of your game window (which is different from resolution. Resolution refers to pixels per area).

If you strongly don't want to do that, you can try this (I've not tested it).

Open the Upgrade Slots plugin, go to line 1038 and change it to this:
Code:
      if (!i % 2) dx += this.textWidth(text) + 10; else dy += this.lineHeight();
You Sir are a legend, it works like a charm! One quick thing, and I am kicking myself for not having mentioned it in my original post. Certain weapons will be able to have up to 3 slots for upgrades... any chance its possible to fit in the 3rd upgrade on the same line as well. Atm if I add the 3rd upgrade it jumps to the line below. sry I should have mentioned that.

I have bee playing with the +10 number in your code as I thought that might do it but I was obviously wrong.

I really appreciate your fast help, its very kind of you mate thx.

PS I didn't even know that I could change the window dimensions as well
Screenshot2.png
PS I didn't even know that I could change the window dimensions as well
That's odd, because you already have - 1200 x 624 is not MV's default window size.

Anyhow, are you sure three will fit? The code change I gave you should print them in two columns. If you're sure there's room for a third, just change i % 2 to i % 3

And then, yes, the 10 is how much space to have between the entries.
That's odd, because you already have - 1200 x 624 is not MV's default window size.

Anyhow, are you sure three will fit? The code change I gave you should print them in two columns. If you're sure there's room for a third, just change i % 2 to i % 3

And then, yes, the 10 is how much space to have between the entries.
Yeah I used Yanfly's core engine to change the resolution..... I see now what you mean...
I got quite a lot of maps etc already based on the 1200 x 624 but I suppose increasing the vertical size would probably mean everything can fit vertically.

I did adjust i % 2 to i % 3 , also played with the 10 value but unfortunately nothing seems to be changing. Its still shown as in the pic above.
sry for being a pain
Oh, I do see one mistake I made. When you go to the next line, you also need to reset the x.

So what I posted should be:
Code:
      if (!i % 2) dx += this.textWidth(text) + 10; else {dy += this.lineHeight(); dx = this.textPadding();}

Unfortunately, I don't know why trying to add the third column wouldn't work. That would be:
Code:
      if (!i % 3) dx += this.textWidth(text) + 10; else {dy += this.lineHeight(); dx = this.textPadding();}
Oh, I do see one mistake I made. When you go to the next line, you also need to reset the x.

So what I posted should be:
Code:
      if (!i % 2) dx += this.textWidth(text) + 10; else {dy += this.lineHeight(); dx = this.textPadding();}

Unfortunately, I don't know why trying to add the third column wouldn't work. That would be:
Code:
      if (!i % 3) dx += this.textWidth(text) + 10; else {dy += this.lineHeight(); dx = this.textPadding();}
Hm weird... anyway thx for all your help so far. Maybe I will restrict the number of upgrade slots to 2 for the time being or look into increasing window size as you suggested.
Thank you

Original thread: https://forums.rpgmakerweb.com/threads/help-with-yanflys-item-upgrade-slots-plugin.166033/