diff --git a/CHANGELOG.md b/CHANGELOG.md index f6a6874..d9bcde0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.4.1 + +Made the breaking change less breaking! + +Also introduces persistency to chat portrait scaling and hiding thanks to @MrVauxs! + # 1.4.0 Made the 'pop out' portrait scaling work for tokens of different scaling factors. diff --git a/module.json b/module.json index d09c1c5..5731149 100644 --- a/module.json +++ b/module.json @@ -4,12 +4,12 @@ "description": "Overhauls the Foundry UI and several modules.", "url": "https://github.com/Dorako/pf2e-dorako-ui", "author": "Dorako", - "version": "1.4.0", + "version": "1.4.1", "minimumCoreVersion": "9", "compatibleCoreVersion": "9", "system": ["pf2e"], "scripts": ["scripts/dorako-ui.js"], "templates": ["templates/*"], - "download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.4.0.zip", + "download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.4.1.zip", "manifest": "https://github.com/Dorako/pf2e-dorako-ui/raw/main/module.json" } diff --git a/scripts/dorako-ui.js b/scripts/dorako-ui.js index ad9652e..d83b06a 100644 --- a/scripts/dorako-ui.js +++ b/scripts/dorako-ui.js @@ -192,7 +192,10 @@ Hooks.once("init", async function () { Hooks.on("preCreateChatMessage", (message) => { // To quote Polyglot's code // "Since FVTT 0.8, it has to use Document#Update instead of Document#SetFlag because Document#SetFlag can't be called during the preCreate stage." - message.data.update({ "flags.pf2eDorakoUi.tokenScale": message?.token?.data?.scale }); + message.data.update({ + "flags.pf2eDorakoUi.tokenScale": message?.token?.data?.scale, + "flags.pf2eDorakoUi.wasTokenHidden": message?.token?.data?.hidden, + }); }); Handlebars.registerHelper("getTokenScale", function (message) { @@ -312,8 +315,9 @@ Hooks.once("init", async function () { if (chatPortraitSetting === "none") return false; - const tk = canvas.tokens?.get(message.speaker.token); - const isHidden = tk?.data.hidden; + // const tk = canvas.tokens?.get(message.speaker.token); + // const isHidden = tk?.data.hidden; + const isHidden = message?.flags?.pf2eDorakoUi?.wasTokenHidden; if (hidePortraitWhenHidden && isHidden) return false; const whisperTargets = message.whisper;