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
2,872
Reaction score
1,011
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,069
Reaction score
1,485
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,069
Reaction score
1,485
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:
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

People3_1 and People3_2 added!

Part 2 of my Audio Engine tutorial for MZ is out!
Come join our stream starting at 2pm and win cool stuff! :D
Star citizen just announced they will develop a roadmap for their planned roadmap...
And i thought i needed order on my project... :kaoswt2:
Big City Greens had it right:
"Always back up your brain game, that's what I like to say!"

Forum statistics

Threads
105,708
Messages
1,015,785
Members
137,387
Latest member
Reeman326
Top