From a03e6e7135eba1219737de80e4d2f40ca4673fd0 Mon Sep 17 00:00:00 2001 From: Dorako Date: Mon, 18 Jul 2022 22:33:17 +0200 Subject: [PATCH] 1.4.2 --- CHANGELOG.md | 4 ++++ module.json | 4 ++-- scripts/dorako-ui.js | 34 +++++++++++----------------------- styles/chat.css | 4 ++++ 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9bcde0..4677d03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.4.2 + +Fixed an issue that caused roundtrackers from Monk's Little Details to now show up. + # 1.4.1 Made the breaking change less breaking! diff --git a/module.json b/module.json index 5731149..0389ea6 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.1", + "version": "1.4.2", "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.1.zip", + "download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.4.2.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 d83b06a..36a302d 100644 --- a/scripts/dorako-ui.js +++ b/scripts/dorako-ui.js @@ -165,14 +165,14 @@ Hooks.once("init", async function () { if (speaker) { if (speaker.token) { tokenImg = game.scenes.get(speaker.scene)?.tokens?.get(speaker.token) - ?.data.img; + ?.data?.img; } if (speaker.actor) { const actor = Actors.instance.get(speaker.actor); combatantImg = combatImagesActive ? actor.getFlag("combat-tracker-images", "trackerImage") : null; - actorImg = actor?.data.img; + actorImg = actor?.data?.img; } } @@ -220,14 +220,14 @@ Hooks.once("init", async function () { if (speaker) { if (speaker.token) { tokenImg = game.scenes.get(speaker.scene)?.tokens?.get(speaker.token) - ?.data.img; + ?.data?.img; } if (speaker.actor) { const actor = Actors.instance.get(speaker.actor); combatantImg = combatImagesActive ? actor.getFlag("combat-tracker-images", "trackerImage") : null; - actorImg = actor?.data.img; + actorImg = actor?.data?.img; } } @@ -257,28 +257,17 @@ Hooks.once("init", async function () { if (speaker) { if (speaker.token) { tokenImg = game.scenes.get(speaker.scene)?.tokens?.get(speaker.token) - ?.data.img; + ?.data?.img; } if (speaker.actor) { const actor = Actors.instance.get(speaker.actor); combatantImg = combatImagesActive ? actor.getFlag("combat-tracker-images", "trackerImage") : null; - actorImg = actor?.data.img; + actorImg = actor?.data?.img; } } - let sizeClass = ""; - const border = game.settings.get("pf2e-dorako-ui", "chat-portrait-border"); - const popoutTokenPortraits = game.settings.get( - "pf2e-dorako-ui", - "popout-token-portraits" - ); - if (!border && popoutTokenPortraits) { - const tk = canvas.tokens?.get(message.speaker.token); - const scale = tk?.data.scale; - } - const main = game.settings.get("pf2e-dorako-ui", "insertSpeakerImage"); if (main === "token") { return ( @@ -315,8 +304,6 @@ Hooks.once("init", async function () { if (chatPortraitSetting === "none") return false; - // const tk = canvas.tokens?.get(message.speaker.token); - // const isHidden = tk?.data.hidden; const isHidden = message?.flags?.pf2eDorakoUi?.wasTokenHidden; if (hidePortraitWhenHidden && isHidden) return false; @@ -330,6 +317,7 @@ Hooks.once("init", async function () { whisperTargets[0] === message.user; const user = game.users.get(message.user); + if (!user) return false; if (hideGmIconWhenSecret && user.isGM && (isBlind || isSelf)) { return false; } @@ -342,14 +330,14 @@ Hooks.once("init", async function () { if (speaker) { if (speaker.token) { tokenImg = game.scenes.get(speaker.scene)?.tokens?.get(speaker.token) - ?.data.img; + ?.data?.img; } if (speaker.actor) { const actor = Actors.instance.get(speaker.actor); combatantImg = combatImagesActive ? actor.getFlag("combat-tracker-images", "trackerImage") : null; - actorImg = actor?.data.img; + actorImg = actor?.data?.img; } } @@ -388,7 +376,7 @@ Hooks.once("init", async function () { const headerStyle = game.settings.get("pf2e-dorako-ui", "headerStyle"); if (headerStyle === "tint") { const user = game.users.get(message.user); - const hexColor = user.data.color.replace("#", ""); + const hexColor = user?.data?.color.replace("#", ""); var r = parseInt(hexColor.substr(0, 2), 16); var g = parseInt(hexColor.substr(2, 2), 16); var b = parseInt(hexColor.substr(4, 2), 16); @@ -441,7 +429,7 @@ Hooks.once("init", async function () { return "transparent"; } const user = game.users.get(message.user); - return user.data.color; + return user?.data?.color; }); Handlebars.registerHelper("getHeaderStyle", function () { diff --git a/styles/chat.css b/styles/chat.css index 886fbc0..4cf514e 100644 --- a/styles/chat.css +++ b/styles/chat.css @@ -1445,6 +1445,10 @@ div#scrollToBottom:hover { border-bottom: 1px solid wheat; } +#chat-log .message.round-marker { + border-bottom: none; +} + #chat h2 { border-bottom: 1px solid var(--pf2e-color-ornament); }