-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathKru_MapLoadEvents.js
More file actions
34 lines (30 loc) · 896 Bytes
/
Copy pathKru_MapLoadEvents.js
File metadata and controls
34 lines (30 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//=============================================================================
// Kru_MapLoadEvents.js
//=============================================================================
/*:
* @plugindesc Runs scripts on map change.
* @author Krusynth
*
* @help This plugin allows for custom javascript to be run on map load. Add a
* load tag and follow it with whatever code you want to execute.
*
* Example:
* <load:console.log("test ABC");>
*
* TODO: Add global events.
*
*/
var Kru = Kru || {};
Kru.MLE = {
};
// Automatically switch parties on transfer if the map has a party tag.
Kru.MLE.Game_Player__performTransfer = Game_Player.prototype.performTransfer;
Game_Player.prototype.performTransfer = function() {
if(
$dataMap.meta &&
typeof $dataMap.meta.load !== 'undefined'
) {
eval($dataMap.meta.load);
}
Kru.MLE.Game_Player__performTransfer.call(this);
}