/*=============================================================================
* CallMenu.js
*=============================================================================*/
/*:
* @plugindesc v1.0 Call menu during messages\choices on map by pressing one of the standart menu keys ESC, X, Insert, NUM 0.
* @author Krimer
*
@Help
* If you want call menu during choices just disallow cancel in choice command.
* Place this plugin below non-standart message systems or choice windows in
* plugin manager for compatibility.
*/
/* OVERWRITE */
DataManager.makeSaveContents = function() {
var contents = {};
contents.system = $gameSystem;
contents.screen = $gameScreen;
contents.timer = $gameTimer;
contents.switches = $gameSwitches;
contents.variables = $gameVariables;
contents.selfSwitches = $gameSelfSwitches;
contents.actors = $gameActors;
contents.party = $gameParty;
contents.map = $gameMap;
contents.player = $gamePlayer;
contents.message = $gameMessage;
return contents;
};
/* OVERWRITE */
DataManager.extractSaveContents = function(contents) {
$gameSystem = contents.system;
$gameScreen = contents.screen;
$gameTimer = contents.timer;
$gameSwitches = contents.switches;
$gameVariables = contents.variables;
$gameSelfSwitches = contents.selfSwitches;
$gameActors = contents.actors;
$gameParty = contents.party;
$gameMap = contents.map;
$gamePlayer = contents.player;
$gameMessage = contents.message;
};
/* Alias */
var _Scene_Map_update_Alias = Scene_Map.prototype.update;
Scene_Map.prototype.update = function() {
_Scene_Map_update_Alias.call(this);
if (Input.isTriggered('escape') && $gameMessage.isBusy()) {
this.callMenu();
}
};
/* OVERWRITE */
Window_Message.prototype.isTriggered = function() {
return (Input.isRepeated('ok') || TouchInput.isRepeated());
};
/* OVERWRITE */
Window_ChoiceList.prototype.updatePlacement = function() {
var positionType = $gameMessage.choicePositionType();
var messageY = this._messageWindow.y;
this.height = this.windowHeight();
switch (positionType) {
case 0:
this.x = 0;
break;
case 1:
this.x = (Graphics.boxWidth - this.width) / 2;
break;
case 2:
this.x = Graphics.boxWidth - this.width;
break;
}
if (messageY >= Graphics.boxHeight / 2) {
this.y = messageY - this.height;
} else {
this.y = messageY + this._messageWindow.height;
}
};
/* OVERWRITE */
Window_ChoiceList.prototype.windowWidth = function() {
return Graphics.boxWidth;
};
/* OVERWRITE */
Window_ChoiceList.prototype.drawItem = function(index) {
var rect = this.itemRectForText(index);
this.drawTextEx(this.commandName(index), rect.x, rect.y);
this.width = this.maxChoiceWidth() + this.padding * 2;
this.updatePlacement();
};
/* End of File */