Hey folks!
I've built a new menu system that runs directly within Scene_Map instead of pushing Scene_Menu (so the menu doesn't pause the game).
It all works fine. I have it mapped to "P" on the keyboard at the moment for testing.
But I can't figure out how to disable the old menu system to replace it with the new one... can't see where 'X' is being mapped or how 'ESC' is triggering the menu.
Ideally I'd like to replace the function of 'X' to run my own command instead of bringing up Scene_Menu.
Can anyone point me in the right direction pleeeaassse?
Not sure if this is helpful or not but you could possibly Use the "Change Menu Access" event trait. I think its in tab 3 of the event commands. If you disable it right away in the game before the player has control it should work. But The other problem of binding it to a new key I'm not sure about, sorry!
Urg, no. Looks like it still pops the scene when the menu is closed... gonna dig deeper.
Aha. duh. I imported this.popScene(); from Scene_Menu's closeCommand();
Also had to change this to return false
Scene_Map.prototype.isMenuCalled = function() {
return false;
};
Now I think it's working.
No, found more bugs. It works when I trigger it from 'P' but the process for callMenu must have a lot more going on. I'll update here if I find a good way to do it.
Feels like a bit of a hack, but so far all looks good.
Replaced 'X' in Input keymapper from 'escape' to 'mapMenu', then stuck this in the Scene_Map update
if (Input.isTriggered("mapMenu")) {
if (this._ringCommandWindow.visible) {
SoundManager.playCancel();
this.closeCommand();
} else if (this._itemWindow.visible) {
SoundManager.playCancel();
this._helpWindow.hide();
this.closeItem();
this.openRingCommand();
} else if (this._quickSpellWindow.visible) {
SoundManager.playCancel();
this._helpWindow.hide();
this.closeQuickSpell();
this.openRingCommand();
} else if (!this._ringCommandWindow.visible) {
SoundManager.playOk();
this.openRingCommand();
}
}
Which basically changes the function of the X key to either open the command menu, or close the active menu, which is similar to its default function.
Escape still does it's own thing. I'll prob remap that to do something else like push Scene_Options since I don't mind that pausing the game.