From c6daf7e709ca3bf0a3ef1212fd813a293702836f Mon Sep 17 00:00:00 2001 From: dev7355608 Date: Wed, 9 Aug 2023 15:56:12 +0200 Subject: [PATCH] Fix compatibility with DFreds Convenient Effects --- module.json | 6 +++--- scripts/compatibility.mjs | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/module.json b/module.json index acee591..f3f583a 100644 --- a/module.json +++ b/module.json @@ -8,7 +8,7 @@ "email": "dev7355608@gmail.com" } ], - "version": "1.9.0", + "version": "1.9.1", "compatibility": { "minimum": "11.299", "verified": "11.307" @@ -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" diff --git a/scripts/compatibility.mjs b/scripts/compatibility.mjs index ce96005..b47cfe2 100644 --- a/scripts/compatibility.mjs +++ b/scripts/compatibility.mjs @@ -166,7 +166,7 @@ Hooks.once("init", () => { } ); - Hooks.once("dfreds-convenient-effects.ready", async () => { + async function addStatusEffects() { if (!game.users.activeGM?.isSelf) { return; } @@ -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); + } }); });