//=============================================================================
// MessageHide.js
//=============================================================================
/*:
@plugindesc v0.1.0 Define a key the player can press to toggle whether the message window is shown.
@author Jatopian
@param key
@desc Key that toggles message window visibility when pressed. See help for list.
@default ctrl
@help
Message window visibility is reset to 'on' by bringing up the menu
or resetting the game,
as well as by pressing the key a second time.
"key" parameter takes values 0-9, a-z, or any of these:
tab
enter
shift
ctrl
alt
space
semicolon
comma
period
quote
pageup
pagedown
Or any of these, for gamepad compatibility:
ok
cancel
shift
menu
pageup
pagedown
up
down
left
right
Terms of Use:
- Free for commercial and non-commercial use.
- Please give credit in a trivially accessible place.
- OK to modify, but if you redistribute the modified version,
please make clear that you modified it, and how.
- If you add features that could be useful to others,
please at least consider sharing them with me and the community.
*/
(function() {
var params = PluginManager.parameters("MessageHide");
var pKey = String(params["key"]).toLowerCase();
var key_ids = {
"tab":9,"enter":13,"shift":16,"ctrl":17,"alt":18,"space":32,
"0":48,"1":49,"2":50,"3":51,"4":52,"5":53,"6":54,"7":55,"8":56,"9":57,
"a":65,"b":66,"c":67,"d":68,"e":69,"f":70,"g":71,"h":72,"i":73,"j":74,"k":75,"l":76,"m":77,
"n":78,"o":79,"p":80,"q":81,"r":82,"s":83,"t":84,"u":85,"v":86,"w":87,"x":88,"y":89,"z":90,
"semicolon":186,"comma":188,"period":190,"quote":222,
};
Input.keyMapper[key_ids[pKey]] = "messageHide";
messageWindowForceShow = false;
//=============================================================================
// Window Message
//=============================================================================
var alias_wm_ud = Window_Message.prototype.update;
Window_Message.prototype.update = function() {
alias_wm_ud.call(this);
if (Input.isTriggered("messageHide") === true) {
this.visible = !this.visible;
}
if (messageWindowForceShow === true){
this.visible = true;
messageWindowForceShow = false;
}
}
//=============================================================================
// Game Interpreter
//=============================================================================
var alias_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args) {
alias_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === "ShowMessageWindow") {
messageWindowForceShow = true;
}
}
})();