MV Changing the lenght of choice's highlight.

Is there a plugin that would let me change how big a choice's highlight is?
This can be done by editing the code within your files directly with programs like Notepad++ or Visual Studio Code. (I did that for an event of mine too). The usual length for Choices is about 6, the easiest way to go about it is to make all the choices that you need (to get the codelines for them) and then lastly edit the numbers
ss1.png

this is a choice pattern that has only 6 choices by code even if it is telling you by the 9 that it should be 9 windows, the game will generate the other windows but will be treated as empty.

ss2.png

I copied the necessary code over to the next slot and changed the number before "Merida Village" to 6, to assign it to the 7th slot right after "Cancel". after you were to save your edited code you can actually edit it in the RPG Maker Engine as well.
ss3.PNG


Make an example of your choice you want to do, copy/paste your stuff to make it visible and then edit the stuff you need in that extra choice. don't forget to change the amount of choices to display in the game as well!!

There might be a different solution to that but I recommend using a Common Event to trigger that big choice window, it's easier to find that way too.

Common Events can be found in your data folder after going to your game's folder.

EDIT: I put "Merida Village" into the wrong slot but it will still work as intended!
if you mean more than 6 choices, you can download it [here].
link is to MV, but its made compitable with MZ as well 🙂

if you mean the width, there was a plugin to control with the amount
of the max characters on that list, there is also 1 with multi-line if you need it.

but I need to check the link for that one.

Never change JSON files as it can break the game if you do something wrong.
@B3N4ZC4L What does all of that have to do with how a choice is highlighted? That's editing how many choices there are.

I agree with @ShadowDragon - I think one should recommend/use a plugin before manually editing the database files, just because of the potential to bork your project. But I don't think this relates to the question 😉

@ecilla1 Can you provide a screenshot mockup showing what you're trying to achieve?
@B3N4ZC4L What does all of that have to do with how a choice is highlighted? That's editing how many choices there are.

I agree with @ShadowDragon - I think one should recommend/use a plugin before manually editing the database files, just because of the potential to bork your project. But I don't think this relates to the question 😉

@ecilla1 Can you provide a screenshot mockup showing what you're trying to achieve?
Hello! Sorry for the late reply.

Below I attached a choice window with 2 choices, and as you can see the highlighted part, the box itself is too short for my liking. I would want to adjust how tall it is, and maybe also it's Y axis while not touching where the text itself currently is.
if you mean more than 6 choices, you can download it [here].
link is to MV, but its made compitable with MZ as well 🙂

if you mean the width, there was a plugin to control with the amount
of the max characters on that list, there is also 1 with multi-line if you need it.

but I need to check the link for that one.

Never change JSON files as it can break the game if you do something wrong.
I'm sorry for the confusion, I am asking how to adjust how tall the highlight part is, not the width.
so far I can see, the text is not centered.

aside from that, there is around6/10px gap on top/bottom and sides by default.
you can get rid of it if you like adjust the height of the choice window to increase
the selector.

another way that I use for my bestiary is to "highlight" the text, so the selector
around the text is gone 🙂

I dont know how to increase the selector manually in the choicelist rather than
globally.
so far I can see, the text is not centered.

aside from that, there is around6/10px gap on top/bottom and sides by default.
you can get rid of it if you like adjust the height of the choice window to increase
the selector.

another way that I use for my bestiary is to "highlight" the text, so the selector
around the text is gone 🙂

I dont know how to increase the selector manually in the choicelist rather than
globally.
Yes I adjusted the text because the tail of Y is being cut off.
But I don't know how to adjust the highlight itself which bugs me because now it looks really weird. xD
Well that would be the question - how did you adjust the text?

By default, the text in areas like that will be centered and the cursor will cover it with some space on the top and bottom.

So it looks like you've changed the font and changed the spacing, which may or may not have been the correct thing to do after changing the font.
The highlight should adjust to the window's line height. Is this the only problem with this font, or are there others, e.g. lines being to close together in messages?
Well that would be the question - how did you adjust the text?

By default, the text in areas like that will be centered and the cursor will cover it with some space on the top and bottom.

So it looks like you've changed the font and changed the spacing, which may or may not have been the correct thing to do after changing the font.
Yes I used a plugin to change the font size of the choices.
And another plugin to change the actual location of the choices' X and Y.
I provided both plugins below.

For the actual Y positioning of the text in the highlighted part, I only found one solution which I followed so that the tail of the texts doesn't cut off. If there's a better solution, please let me know.

Unfortunately there's no highlight adjustment in the plugins below.
Well, if the cursor height in the choice window really is the only issue, this should solve it:

JavaScript:
Window_ChoiceList.prototype.setCursorRect = function (x, y, width, height) {
    const STRETCH_RATIO = 0.5; //How much to stretch the cursor by, e.g. 0.5 will make it 50% longer
    Window.prototype.setCursorRect.call(this, x, y - height * STRETCH_RATIO / 2, width, height * (1 + STRETCH_RATIO));
}

This will make it 50% taller - you can change 0.5 to other numbers until you find one that looks good.
Just to mention it, you generally shouldn't be attaching plugin files to your posts - many authors' terms of use prohibit redistribution.

Just link us to where we can get the file on our own.
Just to mention it, you generally shouldn't be attaching plugin files to your posts - many authors' terms of use prohibit redistribution.

Just link us to where we can get the file on our own.
Oh my mistake, I will take them down.
Well, if the cursor height in the choice window really is the only issue, this should solve it:

JavaScript:
Window_ChoiceList.prototype.setCursorRect = function (x, y, width, height) {
    const STRETCH_RATIO = 0.5; //How much to stretch the cursor by, e.g. 0.5 will make it 50% longer
    Window.prototype.setCursorRect.call(this, x, y - height * STRETCH_RATIO / 2, width, height * (1 + STRETCH_RATIO));
}

This will make it 50% taller - you can change 0.5 to other numbers until you find one that looks good.
Hello, sorry for the late reply, I only tried it just now and it seemed to make the highlight wider, but not taller.
Hello, sorry for the late reply, I only tried it just now and it seemed to make the highlight wider, but not taller.
It does work for me, so I suppose one of your plugins is messing with it, and in a rather cursed way if changing the height affects the width instead xD. Wild hunch: maybe whatever you're using to have the options horizontally rotates the cursor rect as well? Try changing the width instead and see what happens:
JavaScript:
Window_ChoiceList.prototype.setCursorRect = function (x, y, width, height) {
    const STRETCH_RATIO = 0.5; //How much to stretch the cursor by, e.g. 0.5 will make it 50% longer
    Window.prototype.setCursorRect.call(this, x - width * STRETCH_RATIO / 2, y, width * (1 + STRETCH_RATIO), height);
}
It does work for me, so I suppose one of your plugins is messing with it, and in a rather cursed way if changing the height affects the width instead xD. Wild hunch: maybe whatever you're using to have the options horizontally rotates the cursor rect as well? Try changing the width instead and see what happens:
JavaScript:
Window_ChoiceList.prototype.setCursorRect = function (x, y, width, height) {
    const STRETCH_RATIO = 0.5; //How much to stretch the cursor by, e.g. 0.5 will make it 50% longer
    Window.prototype.setCursorRect.call(this, x - width * STRETCH_RATIO / 2, y, width * (1 + STRETCH_RATIO), height);
}
Okay I think I know what is happening now.
I used the last script you gave and it did stretch the width.
I think something is limiting how much it can be stretched.
I think the first code is working, but because of the limit, you cannot notice any difference in height.

I have no idea, however which causes the limit.
I turned off both of the plugins I mentioned above because as far as I'm aware, those are the only ones that are modifying how the actual choices work. And it still has the limit thing.
So, horizontal stretching works, but vertical stretching still has no effects even without those plugins? The plot thickens.

My next suspect is content padding, it might limit where a highlight can be drawn. Try this:
JavaScript:
void ((alias) => {
    Window_ChoiceList.prototype.itemHeight = function () {
        return 2 * alias.call(this);
    }
})(Window_ChoiceList.prototype.itemHeight);
Together with the vertical stretching script from earlier.
If it does change something, but not what you wanted, please share screenshots of how it ended up looking like.
So, horizontal stretching works, but vertical stretching still has no effects even without those plugins? The plot thickens.

My next suspect is content padding, it might limit where a highlight can be drawn. Try this:
JavaScript:
void ((alias) => {
    Window_ChoiceList.prototype.itemHeight = function () {
        return 2 * alias.call(this);
    }
})(Window_ChoiceList.prototype.itemHeight);
Together with the vertical stretching script from earlier.
If it does change something, but not what you wanted, please share screenshots of how it ended up looking like.
First, thank you very much for the help.
I will try it as soon as I get home and will send screenshots of how they turned out!
So, horizontal stretching works, but vertical stretching still has no effects even without those plugins? The plot thickens.

My next suspect is content padding, it might limit where a highlight can be drawn. Try this:
JavaScript:
void ((alias) => {
    Window_ChoiceList.prototype.itemHeight = function () {
        return 2 * alias.call(this);
    }
})(Window_ChoiceList.prototype.itemHeight);
Together with the vertical stretching script from earlier.
If it does change something, but not what you wanted, please share screenshots of how it ended up looking like.
It works!
Thank you very much! I guess padding was somehow modified?

Original thread: https://forums.rpgmakerweb.com/threads/changing-the-lenght-of-choices-highlight.162121/