-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvars.js
More file actions
23 lines (20 loc) · 789 Bytes
/
vars.js
File metadata and controls
23 lines (20 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// About Time v13.0.5 — macro globals (legacy convenience)
Hooks.once("ready", () => {
const api = game.abouttime ?? game.Gametime ?? null;
if (!api) { console.warn("about-time | vars.js: abouttime API not found; globals not set."); return; }
try {
globalThis.DMf = api.DMf;
globalThis.DTM = api.DTM;
globalThis.DTC = api.DTC;
globalThis.DTNow = globalThis.DTNow ?? api.DTNow ?? (() => game.time.worldTime);
if (!("DTf" in globalThis)) {
// @ts-ignore
globalThis.DTf = (...args) => {
console.warn("about-time | DTf is not defined in v13; use DMf (DTMod.create) instead.", args);
return api.DMf?.(...args);
};
}
} catch (err) {
console.error("about-time | vars.js: failed to set convenience globals", err);
}
});