Add plugin command to show/hide

The attached file is the plugin I'm using. I want to add plugin logic so that i can show/hide or enable/disable the plugin with a plugin or script command. I have no knowledge of java and would love some help. Thanks!
To hide it, use the following script call
(In event commands, go to the last page, and the last group of commands for the 'Script' command.

SceneManager._scene.removeChild(SceneManager._scene._absKeys)

To add it back, use
SceneManager._scene.addChild(SceneManager._scene._absKeys)


With my tests, this does seem to disable/enable it as well
@nintendowii111 Please do not repost plugins, as most plugin writers prefer that people link back to the web page where the plugin is hosted.
Would you therefore please edit your post to remove the plugin and give the link instead. Thanks.
@nintendowii111 Please do not repost plugins, as most plugin writers prefer that people link back to the web page where the plugin is hosted.
Would you therefore please edit your post to remove the plugin and give the link instead. Thanks.
The reason I attached the plugin instead of referencing it is because first, it is no longer supported and second, because I edited some code from the original that makes it compatible with the newest version of QABS (which is also no longer supported) sorry for the inconvenience.

To hide it, use the following script call
(In event commands, go to the last page, and the last group of commands for the 'Script' command.

SceneManager._scene.removeChild(SceneManager._scene._absKeys)

To add it back, use
SceneManager._scene.addChild(SceneManager._scene._absKeys)


With my tests, this does seem to disable/enable it as well
I'll try this, thanks very much for the help!
Np ^^ I only did a basic test, for TouchInput in the area where the Input pad originally appears.
Also, this is only going to remove it from the map temporarily.
I assume you know some JS, you'd have to alias something like Scene_Map.prototype.onMapLoaded, or something more suitable for what your needs are, in order to actually make the changes less temporary.

Just using that command, I'm willing to bet that opening the menu and closing it would bring the Touchpad back up on screen.

If you need help aliasing something or adding a bit more functionality to switch it on and off, let me know.
I'll be happy to write that if you need, but if you know how or think you might, it would be good to try

EDIT: I also just realized you already said you edited some of the script yourself, I suppose you could always just add the functionality directly to that. I usually like to leave stuff alone and change/alias stuff from it elsewhere if possible, but that's my personal preference
Np ^^ I only did a basic test, for TouchInput in the area where the Input pad originally appears.
Also, this is only going to remove it from the map temporarily.
I assume you know some JS, you'd have to alias something like Scene_Map.prototype.onMapLoaded, or something more suitable for what your needs are, in order to actually make the changes less temporary.

Just using that command, I'm willing to bet that opening the menu and closing it would bring the Touchpad back up on screen.

If you need help aliasing something or adding a bit more functionality to switch it on and off, let me know.
I'll be happy to write that if you need, but if you know how or think you might, it would be good to try

EDIT: I also just realized you already said you edited some of the script yourself, I suppose you could always just add the functionality directly to that. I usually like to leave stuff alone and change/alias stuff from it elsewhere if possible, but that's my personal preference
Thanks so much for the generous offer! I really don’t know java lol I just changed QuasiAbs to QABS anywhere in the code because that’s what’s in the new QABS code 🙂
To hide it, use the following script call
(In event commands, go to the last page, and the last group of commands for the 'Script' command.

SceneManager._scene.removeChild(SceneManager._scene._absKeys)

To add it back, use
SceneManager._scene.addChild(SceneManager._scene._absKeys)


With my tests, this does seem to disable/enable it as well
I just tested it and it works like a charm! Thanks so MUCH!
Tell me this, though. When you disable it, if you open and close your menu, does it reappear on screen? Not at my computer atm so I can't test that part.
If it does reappear, I can look into fixing that when I'm at my computer again
I appreciate the help. I only disable it during messages so there isn’t a time when the player has it disabled and can open the menus. If you would still be interested in fixing it I’d greatly appreciate that! Never know if I will need it 😉
You can either add this to the existing plugin (If you're sure editing is/was allowed), or you could add it to it's own document, save it as a .js file and add it to your plugin list beneath the Quasi Plugins.
To toggle the setting, you can now use
$gamePlayer.toggleABSHud(true) to show it and
$gamePlayer.toggleABSHUd() to remove it.

These settings should remain in place until you change them.
i.e. if you toggle it off once, it should stay off until you toggle it on again.
Let me know if there are any issues that you find

Code:
//This is a small plugin to add toggle functionality to QuasiABSHudB.js
Game_Player.prototype._absOn = false;
Game_Player.prototype.toggleABSHud = function(turnOn){
    this._absOn = turnOn ? true : false;
    if(this._absOn){
        SceneManager._scene.addChild(SceneManager._scene._absKeys)
    } else {
        SceneManager._scene.removeChild(SceneManager._scene._absKeys)
    }
}

let sp_alias_SceneMap_OnMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function(){
    sp_alias_SceneMap_OnMapLoaded.call(this);
    if($gamePlayer._absOn){
        this.addChild(this._absKeys)
    } else {
        this.removeChild(this._absKeys)
    }
}
You can either add this to the existing plugin (If you're sure editing is/was allowed), or you could add it to it's own document, save it as a .js file and add it to your plugin list beneath the Quasi Plugins.
To toggle the setting, you can now use
$gamePlayer.toggleABSHud(true) to show it and
$gamePlayer.toggleABSHUd() to remove it.

These settings should remain in place until you change them.
i.e. if you toggle it off once, it should stay off until you toggle it on again.
Let me know if there are any issues that you find

Code:
//This is a small plugin to add toggle functionality to QuasiABSHudB.js
Game_Player.prototype._absOn = false;
Game_Player.prototype.toggleABSHud = function(turnOn){
    this._absOn = turnOn ? true : false;
    if(this._absOn){
        SceneManager._scene.addChild(SceneManager._scene._absKeys)
    } else {
        SceneManager._scene.removeChild(SceneManager._scene._absKeys)
    }
}

let sp_alias_SceneMap_OnMapLoaded = Scene_Map.prototype.onMapLoaded;
Scene_Map.prototype.onMapLoaded = function(){
    sp_alias_SceneMap_OnMapLoaded.call(this);
    if($gamePlayer._absOn){
        this.addChild(this._absKeys)
    } else {
        this.removeChild(this._absKeys)
    }
}
I'll try it out. Thanks very much again!

Original thread: https://forums.rpgmakerweb.com/threads/add-plugin-command-to-show-hide.117103/