-
Notifications
You must be signed in to change notification settings - Fork 1
/
const.js
61 lines (51 loc) · 1.5 KB
/
const.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
60
61
/* globals
game,
Hooks
*/
"use strict";
export const GEOMETRY_CONFIG = {};
GEOMETRY_CONFIG.CenteredPolygons = {};
GEOMETRY_CONFIG.Graph = {};
GEOMETRY_CONFIG.RegularPolygons = {};
GEOMETRY_CONFIG.threeD = {};
export const MODULE_KEYS = {
EV: {
ID: "elevatedvision",
TOKEN_HEIGHT: "tokenHeight",
WALL: { TOP: "top", BOTTOM: "bottom" },
ELEVATION: "elevation",
ACTIVE: false
},
WH: {
ID: "wall-height",
TOKEN_HEIGHT: "tokenHeight",
WALL: { TOP: "top", BOTTOM: "bottom" },
ACTIVE: false
},
LEVELS: {
ID: "levels",
ACTIVE: false
},
LEVELSAUTOCOVER: {
ID: "levelsautocover",
DUCKING: "ducking",
ACTIVE: false
},
TERRAIN_MAPPER: {
ID: "terrainmapper",
ACTIVE: false,
}
};
let MOD = MODULE_KEYS.EV;
MODULE_KEYS.EV.FLAG_TOKEN_HEIGHT = `flags.${MOD.ID}.${MOD.TOKEN_HEIGHT}`;
MODULE_KEYS.EV.FLAG_WALL_TOP = `flags.${MOD.ID}.${MOD.ELEVATION}.${MOD.WALL.TOP}`;
MODULE_KEYS.EV.FLAG_WALL_BOTTOM = `flags.${MOD.ID}.${MOD.ELEVATION}.${MOD.WALL.BOTTOM}`;
MODULE_KEYS.EV.FLAG_PLACEABLE_ELEVATION = `flags.${MOD.ID}.${MOD.ELEVATION}`;
MOD = MODULE_KEYS.WH;
MODULE_KEYS.WH.FLAG_TOKEN_HEIGHT = `flags.${MOD.ID}.${MOD.TOKEN_HEIGHT}`;
MODULE_KEYS.WH.FLAG_WALL_TOP = `flags.${MOD.ID}.${MOD.WALL.TOP}`;
MODULE_KEYS.WH.FLAG_WALL_BOTTOM = `flags.${MOD.ID}.${MOD.WALL.BOTTOM}`;
// Hook init b/c game.modules is not initialized at start.
Hooks.once("init", function() {
for ( const obj of Object.values(MODULE_KEYS) ) obj.ACTIVE = game.modules.get(obj.ID)?.active
});