-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathPolyTypes.js
More file actions
125 lines (125 loc) · 3.58 KB
/
PolyTypes.js
File metadata and controls
125 lines (125 loc) · 3.58 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
;
/**
* Base class for all polytrack mods. Mods should export an instance of their mod class named `polyMod` in their main file.
*/
export class PolyMod {
constructor() {
this.loaded = false;
/**
* Function to run during initialization of mods. Note that this is called *before* polytrack itself is loaded,
* but *after* everything has been declared.
*
* @param pmlInstance - The instance of {@link PolyModLoader}.
*/
this.init = (pmlInstance) => { };
/**
* Function to run after all mods and polytrack have been initialized and loaded.
*/
this.postInit = () => { };
/**
* Function to run once game finishses loading.
*/
this.onGameLoad = () => { };
/**
* Function to run just after import, before anything else.
*
* @param pmlInstance - The instance of {@link PolyModLoader}.
*/
this.preInit = (pmlInstance) => { };
/**
* Whether the mod
*/
this.offlineMode = false;
}
/**
* The the mod's icon file URL.
*/
get iconSrc() {
return this.IconSrc;
}
set iconSrc(src) {
this.IconSrc = src;
}
set setLoaded(status) {
this.loaded = status;
}
/**
* The mod's loaded state.
*/
get isLoaded() {
return this.loaded;
}
/**
* The mod's base URL.
*/
get baseUrl() {
return this.modBaseUrl;
}
set baseUrl(url) {
this.modBaseUrl = url;
}
/**
* Whether the mod is saved as to always fetch latest version (`true`)
* or to fetch a specific version (`false`, with version defined by {@link PolyMod.modVersion}).
*/
get savedLatest() {
return this.latestSaved;
}
set savedLatest(latest) {
this.latestSaved = latest;
}
get initialized() {
return this.modInitialized;
}
set initialized(initState) {
this.modInitialized = initState;
}
}
/**
* This class is used in {@link PolyModLoader}'s register mixin functions to set where functions should be injected into the target function.
*/
export var MixinType;
(function (MixinType) {
/**
* Inject at the start of the target function.
*/
MixinType[MixinType["HEAD"] = 0] = "HEAD";
/**
* Inject at the end of the target function.
*/
MixinType[MixinType["TAIL"] = 1] = "TAIL";
/**
* Override the target function with the new function.
*/
MixinType[MixinType["OVERRIDE"] = 2] = "OVERRIDE";
/**
* Insert code after a given token.
*/
MixinType[MixinType["INSERT"] = 3] = "INSERT";
/**
* Replace code between 2 given tokens. Inclusive.
*/
MixinType[MixinType["REPLACEBETWEEN"] = 5] = "REPLACEBETWEEN";
/**
* Remove code between 2 given tokens. Inclusive.
*/
MixinType[MixinType["REMOVEBETWEEN"] = 6] = "REMOVEBETWEEN";
/**
* Inserts code after a given token, but class wide.
*/
MixinType[MixinType["CLASSINSERT"] = 8] = "CLASSINSERT";
/**
* Replace code between 2 given tokens, but class wide. Inclusive.
*/
MixinType[MixinType["CLASSREMOVE"] = 4] = "CLASSREMOVE";
/**
* Remove code between 2 given tokens, but class wide. Inclusive.
*/
MixinType[MixinType["CLASSREPLACE"] = 7] = "CLASSREPLACE";
})(MixinType || (MixinType = {}));
export var SettingType;
(function (SettingType) {
SettingType["BOOL"] = "boolean";
SettingType["SLIDER"] = "slider";
SettingType["CUSTOM"] = "custom";
})(SettingType || (SettingType = {}));