This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
forked from Hudell/mv-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OrangeOnLoadEvent.js
55 lines (48 loc) · 1.77 KB
/
OrangeOnLoadEvent.js
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*=============================================================================
* Orange - On Load Event
* By Hudell - www.hudell.com
* OrangeOnLoadEvent.js
* Version: 1.0
* Free for commercial and non commercial use.
*=============================================================================*/
/*:
* @plugindesc Will let you call a common event immediately after a load game
*
* @author Hudell
*
* @param commonEventId
* @desc The number of the common event to call
* @default 0
*
* @help
* ============================================================================
* Latest Version
* ============================================================================
*
* Get the latest version of this script on http://link.hudell.com/on-load-event
*
*=============================================================================*/
var Imported = Imported || {};
var OrangeOnLoadEvent = OrangeOnLoadEvent || {};
(function($) {
"use strict";
$.Parameters = PluginManager.parameters('OrangeOnLoadEvent');
$.Param = $.Param || {};
$.Param.commonEventId = Number($.Parameters['commonEventId'] || 0);
var oldGameSystem_onAfterLoad = Game_System.prototype.onAfterLoad;
Game_System.prototype.onAfterLoad = function() {
oldGameSystem_onAfterLoad.call(this);
if ($.Param.commonEventId !== undefined && $.Param.commonEventId > 0) {
$gameTemp.reserveCommonEvent($.Param.commonEventId);
}
};
})(OrangeOnLoadEvent);
if (Imported['MVCommons'] !== undefined) {
PluginManager.register("OrangeOnLoadEvent", "1.0.0", "Will let you call a common event immediately after a load game", {
email: "[email protected]",
name: "Hudell",
website: "http://www.hudell.com"
}, "2015-10-19");
} else {
Imported["OrangeOnLoadEvent"] = true;
}