-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmod.js
31 lines (26 loc) · 838 Bytes
/
mod.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
import {
Spirit
} from "./spirit.js";
export default class MonMod extends Plugin {
constructor(mod) {
super();
this.mod = mod;
this.spirit = new Spirit();
}
async prestart() {
this.spirit.prestart();
await this.loadPatches();
}
async loadPatches() {
const defaultTracks = await this.loadFile("patches/defaultTracks.json");
ig.merge(ig.BGM_DEFAULT_TRACKS, defaultTracks);
const destructible = await this.loadFile("patches/itemDestructible.json");
ig.merge(sc.ITEM_DESTRUCT_TYPE, destructible);
console.log("MonikaMod has successfully loaded.");
}
async loadFile(path) {
const filePath = this.mod.baseDirectory.substring(7) + path;
const req = await fetch(filePath);
return await req.json();
}
}