Status
Not open for further replies.

Oatilis

Veteran
Veteran
Joined
Mar 16, 2016
Messages
41
Reaction score
15
First Language
Hebrew
Primarily Uses
So, in the scenes JS file this code creates the main title menu:

JavaScript:
Scene_Title.prototype.createCommandWindow = function() {
    this._commandWindow = new Window_TitleCommand();
    this._commandWindow.setHandler('newGame',  this.commandNewGame.bind(this));
    this._commandWindow.setHandler('continue', this.commandContinue.bind(this));
    this._commandWindow.setHandler('options',  this.commandOptions.bind(this));
    this.addWindow(this._commandWindow);
};

I'm trying to remove the options command and replace it with an exit command (quitting the game). Just to try it out, I commented out the options command and created a new gameEnd command:

JavaScript:
Scene_Title.prototype.createCommandWindow = function() {
    this._commandWindow = new Window_TitleCommand();
    this._commandWindow.setHandler('newGame',  this.commandNewGame.bind(this));
    this._commandWindow.setHandler('continue', this.commandContinue.bind(this));
    // this._commandWindow.setHandler('options',  this.commandOptions.bind(this));
    this._commandWindow.setHandler('gameEnd', this.commandGameEnd.bind(this));
    this.addWindow(this._commandWindow);
};



Scene_Title.prototype.commandGameEnd = function() {
    SceneManager.exit();
};

However, the "Options" command still appears on the title menu (and the Game End option doesn't).
I figured, maybe the code I changed just sets up the handlers, and it doesn't actually create the title menu, but I couldn't find anywhere else in the codebase that addresses the title menu commands.

So, what am I missing?

P.S.
I saw people refer to SceneManager.exit() as the quit command, but I can't find this method in the class either, so I'm not sure this is actually going to work. Still I don't even see the command in the menu...
 
Last edited:

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
531
Reaction score
278
First Language
thai
Primarily Uses
RMMV
if you use other plugin that messing with title menu
maybe that one overide the code
you can try make and override one out as plugin too
because edit the original js is not recommended
you can forget what you did in a long run
and end up can't find the bug
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
3,816
Reaction score
1,448
First Language
Dutch
Primarily Uses
RMMV
there are many plugins that add just a exit command to the menu.
why not use that, it is not recommand to mess wit hteh main core files,
but rather alias the function and than add it.

here is a link to 1 of the many.
 

Oatilis

Veteran
Veteran
Joined
Mar 16, 2016
Messages
41
Reaction score
15
First Language
Hebrew
Primarily Uses
I know it's better to alias methods, but I also want to understand what's going on.
 

ramza

Lunatic Coder
Veteran
Joined
Jan 28, 2013
Messages
920
Reaction score
579
First Language
English
Primarily Uses
RMMV
That function you're editing is the one that handles what happens when someone clicks on each command on the command window. By commenting it out, I'd expect that the options command is still visible, but it doesn't do anything when you select it.

The function you're looking to change is actually the one in the Window_TitleCommand object that draws the commands:

Code:
Window_TitleCommand.prototype.makeCommandList = function() {
    this.addCommand(TextManager.newGame,   'newGame');
    this.addCommand(TextManager.continue_, 'continue', this.isContinueEnabled());
    this.addCommand(TextManager.options,   'options');
};

You'd probably change the last line to this.addCommand('Quit', 'gameEnd');
 

pasunna

Veteran
Veteran
Joined
Feb 3, 2019
Messages
531
Reaction score
278
First Language
thai
Primarily Uses
RMMV
I know it's better to alias methods, but I also want to understand what's going on.
then next time open up the existing plugin and learn from it
 

Oatilis

Veteran
Veteran
Joined
Mar 16, 2016
Messages
41
Reaction score
15
First Language
Hebrew
Primarily Uses
then next time open up the existing plugin and learn from it
I tried looking into Yanfly's menu plugin, but still, couldn't find where exactly the menu was being created.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,995
Reaction score
8,893
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.


@Oatilis Next time please report it solved. We won't always see it posted or in the title.
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I decided to create reboots of my games on RPG Maker MV. I'm happy. :biggrin:
So, as i finish setting up my items for part 1 of my game, I realized I forgot to finalize an ENTIRE category of items. Know which ones? The Fallen Feathers....BTW my game is called "Fallen Feather"
and_remember_tomorrow_exploding_puzzle_logo.jpg

Made some new friends, and blew up a puzzle... Happens. :LZSwink:
A new RPG Maker music pack is coming out soon! Below is a demo of one of the compositions in the pack, Heroic Battle. More details coming soon!

Trying to build a child-size body. Mostly happy with it except the sideview arms - can't get them to move quite right yet. Anyway, here's the work-in-progress, with an adult for size comparison.
ChildTest-01.gif

I started in VXAce and I liked how the kids flapped their arms so that's why it's just flapping.

Forum statistics

Threads
111,141
Messages
1,058,679
Members
144,372
Latest member
graysome
Top