Moghunter Menu - looping to the left - RMMV

Fitferfer

Villager
Member
Joined
Sep 24, 2018
Messages
13
Reaction score
3
First Language
English
Primarily Uses
RMMV
Hello! I'm using Moghunter's Monogatari menu plugin, and would like to add the ability to simply press "left" to have the menu cursor selection go to the final selection on the right, rather than having to hit "Right" 9 times to get to Quit.

Menu.png

Here's the plugin: https://atelierrgss.wordpress.com/rmv-monogatari/

I can't seem to figure out where in the code the author disabled this option... as it works by default in RMMV. Can anyone help?

Thanks very much!

-Fer
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
3,194
Reaction score
1,190
First Language
Dutch
Primarily Uses
RMMV
I know where to look, but I dont see 9, or 8, but you can look to the cursor saying
if index <= 0, than index = 8 instead of 0
same with the other thing, but I can look tomorrow into it for you, but hopefully someone can help you
on it before me.

But its somewhere between those lines :)
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,635
First Language
EN
Primarily Uses
RMMZ
It's because Mog calls the cursorUp & cursorDown methods without a wrap argument, meaning they'll never wrap. The default code only wraps if you have just pressed the directional key. :kaoswt:

Try saving this one of these a .js file and importing as a plugin:
Code:
Window_MenuCommand.prototype.processCursorMove = function() {
    if (this.isCursorMovable()) {
        var lastIndex = this.index();
        if (Input.isRepeated('down') || Input.isRepeated('right')) {
            this.cursorDown(true);   // <-- edit 1 of 2
        };
        if (Input.isRepeated('up') || Input.isRepeated('left')) {
            this.cursorUp(true);   // <-- edit 2 of 2
        };
        if (this.index() !== lastIndex) {
            SoundManager.playCursor();
        };
    };
};
Code:
Window_MenuCommand.prototype.processCursorMove = function() {
    if (this.isCursorMovable()) {
        var lastIndex = this.index();
        if (Input.isRepeated('down') || Input.isRepeated('right')) {
            this.cursorDown(Input.isTriggered('down') || Input.isTriggered('right'));   // <-- edit 1 of 2
        };
        if (Input.isRepeated('up') || Input.isRepeated('left')) {
            this.cursorUp(Input.isTriggered('up') || Input.isTriggered('left'));   // <-- edit 2 of 2
        };
        if (this.index() !== lastIndex) {
            SoundManager.playCursor();
        };
    };
};
Alternatively, you can simply find the relevant lines in MOG_SceneMenu.js and edit them directly~ :kaothx:
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,227
Reaction score
1,635
First Language
EN
Primarily Uses
RMMZ
OK, just remember that if you happen to update the plugin at some point then you'll need to reapply that edit. :)

Happy RPG Making! :kaojoy:
 

Latest Threads

Latest Posts

Latest Profile Posts

What Reviews say on RPG Maker MZ?
Looking back at some sketches, and game design documents on my PC dated summer of 2015. I started development with the release of MZ, but in 2015, I felt a strong desire to make a game out of the blue. I remember feeling sad for no apparent reason, and all these ideas rushed into my head. Now that I think about it, since that day, everything has become easier to do on my PC . . . it’s very creepy.
Everything's going to be alright! We're all in this together. <3
Aaaaannd published my game's tech demo. :D

Feel free to download and play it. And give feedback!
Hey everyone, we know that the edit bar is missing. We're working on it. You can talk about it in the announcement here: https://forums.rpgmakerweb.com/index.php?threads/forum-errors-missing-edit-bar-etc.132715/

Forum statistics

Threads
107,801
Messages
1,032,304
Members
139,946
Latest member
Yatsekonn
Top