Hello!
I did a title screen with events on a normal map.
I would like to be able to call the Window_TitleCommand on this map. Be it through a switch or script call.
Until then I made this code, however, I do not know what else to do.
can anybody help me?
I did a title screen with events on a normal map.
I would like to be able to call the Window_TitleCommand on this map. Be it through a switch or script call.
Until then I made this code, however, I do not know what else to do.
can anybody help me?
Code:
Scene_Map.prototype.create = function() {
Scene_Base.prototype.create.call(this);
this.createCommandWindow();
};
Scene_Map.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.addChild(this._commandWindow);
};
Scene_Map.prototype.commandNewGame = function() {
DataManager.setupNewGame();
this._commandWindow.close();
this.fadeOutAll();
SceneManager.goto(Scene_Map);
};
Scene_Map.prototype.commandContinue = function() {
this._commandWindow.close();
SceneManager.push(Scene_Load);
};
Scene_Map.prototype.commandOptions = function() {
this._commandWindow.close();
SceneManager.push(Scene_Options);
};
Scene_Map.prototype.updateScene = function() {
this.checkGameover();
if (!SceneManager.isSceneChanging()) {
this.updateTransferPlayer();
}
if (!SceneManager.isSceneChanging()) {
this.updateEncounter();
}
if (!SceneManager.isSceneChanging()) {
this.updateCallMenu();
}
if (!SceneManager.isSceneChanging()) {
this.updateCallDebug();
}
if ($gameSwitches.value(200)) {
if (!this._commandWindow.visible) {
this._commandWindow.show();
} else {
if (this._commandWindow.visible) {
this._commandWindow.hide();
}
};