From 58557a483d36841caaa9367593d4e26bf1dd98a1 Mon Sep 17 00:00:00 2001 From: PwQt Date: Tue, 19 Mar 2024 20:35:51 +0100 Subject: [PATCH] prepare for 1.7.3 release with the dialog box --- src/module.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/module.js b/src/module.js index a157277..ba51d4b 100644 --- a/src/module.js +++ b/src/module.js @@ -39,6 +39,15 @@ Hooks.once("init", () => { config: true, }); + game.settings.register(CONSTANTS.MODULE_ID, "counter", { + name: "counter", + hint: "", + scope: "client", + type: Boolean, + default: false, + config: false, + }); + if (typeof Babele !== "undefined") { Babele.get().register({ module: CONSTANTS.MODULE_ID, @@ -60,6 +69,29 @@ Hooks.once("ready", () => { .forEach((actor) => { MagicItemActor.bind(actor); }); + if (game.settings.get(CONSTANTS.MODULE_ID, "counter") === false && game.user.isGM) { + let x = new Dialog({ + title: "Magic Items Migration", + content: + "The module Magic Items 2 is being moved in the place of the old one - Magic Items.

Magic Items 2 module id will no longer be updated, so please check the Foundry module listing or github page for Magic Items version 4.0.

", + buttons: { + use: { + icon: '', + label: "I have read this message, please don't show it again.", + callback: () => { + game.settings.set(CONSTANTS.MODULE_ID, "counter", true); + }, + }, + close: { + icon: '', + label: "Ignore this message for now", + callback: () => x.close(), + }, + }, + default: "use", + }); + x.render(true); + } }); Hooks.once("createActor", (actor) => {