-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuser-manager.js
37 lines (27 loc) · 939 Bytes
/
user-manager.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
import UserManagerApp from "./modules/logic.js";
Hooks.once("init", () => {
game.userManager = new UserManagerApp();
return loadTemplates([
"modules/user-manager/templates/parts/Tabs.html",
"modules/user-manager/templates/parts/FilterButton.html",
"modules/user-manager/templates/parts/ToggleVisibilityButton.html",
"modules/user-manager/templates/actors.hbs",
]);
});
Hooks.on("ready", () => {
if (!game.userManager) game.userManager = new UserManagerApp();
Handlebars.registerHelper("userManagerFolders", function () {
let actors = game.userManager.getData();
return actors
});
});
Hooks.on("renderActorDirectory", (app, html, data) => {
if (!game.user.isGM) return;
let button = $(
`<button class="user-manager-button"><i class="fas fa-users"></i> User Manager</button>`
);
button.on("click", (e) => {
game.userManager.render(true);
});
$(html).find(".directory-footer").prepend(button);
});