I know how to disable them but I don't know how to disable them for a specific scene, I would like them to not appear in a scene I create. If anyone knows a way to disable them only in a single scene.
☛RPG MZ Disable Assist Buttons Menu☚
RPG Maker MZ SupportThis is more of a JavaScript support question, since you seem to be implying that you are working on a custom scene.
Scenes inherit methods from their parents, so for your scene, you can redefine the method that draws the buttons for your scene's parent (e.g. Scene_Menu or Scene_MenuBase perhaps—I'm not at my PC right now).
You say you know how to disable them but not for a specific scene, but you don't mention what your method for disabling them is, so I'm being somewhat equally ambiguous here in my reply. Feel free to provide more context on what you are specifically trying to do, and why your existing solution isn't applicable, and you'll get a more detailed reply in return.
Scenes inherit methods from their parents, so for your scene, you can redefine the method that draws the buttons for your scene's parent (e.g. Scene_Menu or Scene_MenuBase perhaps—I'm not at my PC right now).
You say you know how to disable them but not for a specific scene, but you don't mention what your method for disabling them is, so I'm being somewhat equally ambiguous here in my reply. Feel free to provide more context on what you are specifically trying to do, and why your existing solution isn't applicable, and you'll get a more detailed reply in return.
As I don't have access to this specific menu and you didn't provide the name, what I can suggest is to include this plugin and use the command to disable the keys when opening the menu and the command to enable when exiting. Just modify your specific menu Plugin.
JavaScript:
/*:
* @plugindesc Disables keys F2, F3 and F4
* @author <NONE>
* @url https://forums.rpgmakerweb.com/index.php?threads/rpg-mz-disable-assist-buttons-menu.166106/
* @help PreventFKeys.js
*
* This prevents keys other than those programmed in RPG_CORE
* preventing the player from accidentally activating native browser commands
*
* Turn OFF: Graphics._FKeysOFF or Graphics.FKeys = false;
* Turn ON: Graphics._FKeysON or Graphics.FKeys = true;
*
* @param isFKeysEnabled
* @text F-keys
* @desc Define whether the F keys will be on or not when starting the game
* @type boolean
* @default true
*/
(function(){
const parameters = PluginManager.parameters("PreventFKeys");
Graphics.FKeys = parameters.isFKeysEnabled || true;
Graphics._FKeysON = function()
{
Graphics.FKeys = true;
}
Graphics._FKeysOFF = function()
{
Graphics.FKeys = false;
}
Graphics._onKeyDown = function(event) {
if (!event.ctrlKey && !event.altKey && Graphics.FKeys == true) {
switch (event.keyCode) {
case 113: // F2
event.preventDefault();
this._switchFPSCounter();
break;
case 114: // F3
event.preventDefault();
this._switchStretchMode();
break;
case 115: // F4
event.preventDefault();
this._switchFullScreen();
break;
}
} else {
event.preventDefault();
}
};
})();
Thanks 😤
Original thread: https://forums.rpgmakerweb.com/threads/rpg-mz-disable-assist-buttons-menu.166106/