Skip to content

Commit

Permalink
1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Jul 18, 2022
1 parent 64dc3c5 commit d89f097
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
10 changes: 7 additions & 3 deletions scripts/dorako-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d89f097

Please sign in to comment.