Skip to content

Commit

Permalink
Fix compatibility with DFreds Convenient Effects
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7355608 committed Aug 9, 2023
1 parent bf32ed6 commit c6daf7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"email": "[email protected]"
}
],
"version": "1.9.0",
"version": "1.9.1",
"compatibility": {
"minimum": "11.299",
"verified": "11.307"
Expand Down Expand Up @@ -47,8 +47,8 @@
},
"url": "https://github.com/dev7355608/vision-5e",
"manifest": "https://github.com/dev7355608/vision-5e/releases/latest/download/module.json",
"download": "https://github.com/dev7355608/vision-5e/releases/download/v1.9.0/module.zip",
"changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v1.9.0",
"download": "https://github.com/dev7355608/vision-5e/releases/download/v1.9.1/module.zip",
"changelog": "https://github.com/dev7355608/vision-5e/releases/tag/v1.9.1",
"bugs": "https://github.com/dev7355608/vision-5e/issues",
"readme": "https://raw.githubusercontent.com/dev7355608/vision-5e/main/README.md",
"license": "https://raw.githubusercontent.com/dev7355608/vision-5e/main/LICENSE"
Expand Down
10 changes: 9 additions & 1 deletion scripts/compatibility.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Hooks.once("init", () => {
}
);

Hooks.once("dfreds-convenient-effects.ready", async () => {
async function addStatusEffects() {
if (!game.users.activeGM?.isSelf) {
return;
}
Expand All @@ -188,6 +188,14 @@ Hooks.once("init", () => {
await game.settings.set("vision-5e", "compatibility.dfreds-convenient-effects", compatibility);
ui.notifications.warn("Foundry must be reloaded to update token status effects.", { permanent: true });
}
}

Hooks.once("dfreds-convenient-effects.ready", () => {
if (game.ready) {
addStatusEffects();
} else {
Hooks.once("ready", addStatusEffects);
}
});
});

Expand Down

0 comments on commit c6daf7e

Please sign in to comment.