// JavaScript source code
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
// JavaScript source code
// OffScreenEventMove
// OffScreenEventMove.js
// Version 1.0
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
var OffScreenEventMove = OffScreenEventMove || {};
/*:
* @plugindesc v1.0 - Allows individual events or globally all events to move while off screen
* @author Leeway
* @help Passing in true to the "All Events Move Offscreen" parameter will make all events 
*       able to move while off screen.
*       For finer control of indivdual events you can use script:
*            EnableOffScreenMove(Id of Event);
*       This will enable off screen moving of a single event.
* 
* @param All Events Move Offscreen
* @desc Set this to true if you want all events in the game to be able to move off screen
* @default false
*/
//
OffScreenEventMove.Parameters = PluginManager.parameters('OffScreenEventMove');
OffScreenEventMove.Param = OffScreenEventMove.Param || {};
OffScreenEventMove.Param.AllEventsCanMove = (OffScreenEventMove.Parameters['All Events Move Offscreen'] === "true");

if (OffScreenEventMove.Param.AllEventsCanMove === true) {
    Game_Event.prototype.OFSParam = OffScreenEventMove.Param.AllEventsCanMove;
    Game_Event.prototype.isNearTheScreen = function () { return true; }
}

function EnableOffScreenMove(eventid) {
    $gameMap._events[eventid].isNearTheScreen = function () { return true; }
}
