- Joined
- Jun 20, 2016
- Messages
- 45
- Reaction score
- 9
- First Language
- Singlish
- Primarily Uses
I tried making a simple plugin to add "Exit to Desktop" command in the option, derived from ARP_TitleCommandExit.
It doesn't work. When the plugin load, the "Exit to Desktop" command shows up in the Options but it does nothing, also there's an error: "cannot read property 'setHandler' of undefined". What am I missing?(function() {
var _Window_Options_makeCommandList = Window_Options.prototype.makeCommandList;
Window_Options.prototype.makeCommandList = function() {
_Window_Options_makeCommandList.call(this);
this.addCommand("Exit to Desktop", 'exitGame');
};
Scene_Options_createOptionsWindow = Scene_Options.prototype.createOptionsWindow;
Scene_Options.prototype.createOptionsWindow = function() {
Scene_Options_createOptionsWindow.call(this);
this._OptionsWindow.setHandler('exitGame', this.commandExitGame.bind(this));
};
Window_Options.prototype.commandExitGame = function() {
SceneManager.exit();
};
})();
