Hello,
A long while ago, I found out RPG MV games could be played with a controller and I thought, "Wow, that sounds really cool!" Then, I tried it out and found how limited that feature is. Well, I have managed to implement the d-pad, right joy stick, and joy stick button presses to do stuff on input.
My problem right now is trying to make the start menu properly close the menu.
This is my code to open the menu:
Well, this works to open the menu. But, I want to be able to press the "start" button on the controller to close it. Since I am aliasing Scene_Map.prototype.update my close menu code doesn't seem to run when the menu is open.
Where should I put my code to close the menu, when the menu is already open?
A long while ago, I found out RPG MV games could be played with a controller and I thought, "Wow, that sounds really cool!" Then, I tried it out and found how limited that feature is. Well, I have managed to implement the d-pad, right joy stick, and joy stick button presses to do stuff on input.
My problem right now is trying to make the start menu properly close the menu.
This is my code to open the menu:
JavaScript:
var _sal.inputMapper.menuState = false;
var Alias_Scene_Map_updateMain = Scene_Map.prototype.updateMain;
Scene_Map.prototype.updateMain = function() {
Alias_Scene_Map_updateMain.call(this);
if (Input.isTriggered('startButton')) {
if (_sal.inputMapper.menuState == false) { //open main menu
_sal.inputMapper.menuState = true;
var soundEffect_toplay = { name: "Skill3", volume: 100, pitch: 110, pan: 0};
AudioManager.playSe(soundEffect_toplay);
SceneManager.push(Scene_Menu);
} else {
_sal.inputMapper.menuState = false;
SceneManager.pop();
}
} //end if 'startButton' pressed
}
Well, this works to open the menu. But, I want to be able to press the "start" button on the controller to close it. Since I am aliasing Scene_Map.prototype.update my close menu code doesn't seem to run when the menu is open.
Where should I put my code to close the menu, when the menu is already open?