-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsherwood.js
59 lines (52 loc) · 1.89 KB
/
sherwood.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
56
57
58
59
import { SHERWOOD } from "./config.js";
import { SherwoodItem } from "./module/item/item.js";
import * as Macros from "./module/macros.js";
import { SherwoodActor } from "./module/actor/actor.js";
import SherwoodActorSheetNPC from "./module/actor/npc-sheet.js";
import SherwoodActorSheetPC from "./module/actor/pc-sheet.js";
import { preloadHandlebarsTemplates } from "./module/templates.js";
import SherwoodItemSheetWeapon from "./module/item/weapon-sheet.js";
import SherwoodItemSheetArmor from "./module/item/armor-sheet.js";
import SherwoodItemSheetAsset from "./module/item/asset-sheet.js";
import SherwoodItemSheetObject from "./module/item/object-sheet.js";
Hooks.once("init", async () => {
console.log("sherwood | Initialising Sherwood System");
game.sherwood = { SherwoodActor, SherwoodItem, macros: Macros };
// CONFIG.debug.hooks = true;
CONFIG.sherwood = SHERWOOD;
Handlebars.registerHelper("isGM", function (options) {
if (game.user.isGM) {
return options.fn(this);
}
return options.inverse(this);
});
CONFIG.Actor.documentClass = SherwoodActor;
CONFIG.Item.documentClass = SherwoodItem;
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("sherwood", SherwoodItemSheetWeapon, {
types: ["weapon"],
makeDefault: true,
});
Items.registerSheet("sherwood", SherwoodItemSheetArmor, {
types: ["armor"],
makeDefault: true,
});
Items.registerSheet("sherwood", SherwoodItemSheetAsset, {
types: ["asset"],
makeDefault: true,
});
Items.registerSheet("sherwood", SherwoodItemSheetObject, {
types: ["object"],
makeDefault: true,
});
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("sherwood", SherwoodActorSheetPC, {
types: ["pc"],
makeDefault: true,
});
Actors.registerSheet("sherwood", SherwoodActorSheetNPC, {
types: ["npc"],
makeDefault: true,
});
await preloadHandlebarsTemplates();
});