!function(){
Input.keyMapper[66] = "Build";
_Scene_Map_update = Scene_Map.prototype.update;
_Scene_Map_initialize = Scene_Map.prototype.initialize;
Scene_Map.prototype.initialize = function() {
_Scene_Map_initialize.call(this);
this._buildModeOn = false;
this._buildModeDirect = 0;
this._buildModeMoving = 0;
};
Scene_Map.prototype.update = function() {
_Scene_Map_update.call(this);
this.updateBuildModeKeyListening();
this.updateBuildModeScrolling();
}
Scene_Map.prototype.updateMain = function() {
var active = this.isActive();
$gameMap.update(active);
$gameTimer.update(active);
$gameScreen.update();
if(!this._buildModeOn){
$gamePlayer.update(active);
}
};
Scene_Map.prototype.updateBuildModeKeyListening = function(){
if(Input.isTriggered("Build")){
this._buildModeOn = !this._buildModeOn;
$gameTemp.clearDestination();
if(!this._buildModeOn){
$gameMap._displayX = $gamePlayer._x - Math.round($gameMap.screenTileX() / 2);
$gameMap._displayY = $gamePlayer._y - Math.round($gameMap.screenTileY() / 2);
$gameMap.scrollUp(0);
$gameMap.scrollDown(0);
$gameMap.scrollLeft(0);
$gameMap.scrollRight(0);
$gameSystem.enableMenu();
}else{
$gameSystem.disableMenu();
}
}
if(Input.isPressed("up") && this._buildModeOn && this._buildModeDirect == 0){
this._buildModeDirect = 1;
}
if(Input.isPressed("down") && this._buildModeOn && this._buildModeDirect == 0){
this._buildModeDirect = 2;
}
if(Input.isPressed("left") && this._buildModeOn && this._buildModeDirect == 0){
this._buildModeDirect = 3;
}
if(Input.isPressed("right") && this._buildModeOn && this._buildModeDirect == 0){
this._buildModeDirect = 4;
}
}
Scene_Map.prototype.updateBuildModeScrolling = function(){
switch(this._buildModeDirect){
case 0: break;
case 1:
this._buildModeMoving++;
$gameMap.scrollUp(0.1);
break;
case 2:
this._buildModeMoving++;
$gameMap.scrollDown(0.1);
break;
case 3:
this._buildModeMoving++;
$gameMap.scrollLeft(0.1);
break;
case 4:
this._buildModeMoving++;
$gameMap.scrollRight(0.1);
break;
}
if(this._buildModeMoving >= 10){
this._buildModeDirect = 0;
this._buildModeMoving = 0;
}
}
}();