From 20809f9523e8cf89eeb690746aaf16d3d83bd09a Mon Sep 17 00:00:00 2001 From: Dorako Date: Sat, 21 May 2022 10:01:38 +0200 Subject: [PATCH] v1.3.22 --- CHANGELOG.md | 4 ++++ module.json | 4 ++-- scripts/dorako-ui.js | 14 +++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec857e5..80e7ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.3.22 + +Fixed chat messages not showing up if PF2e Combat Tracker Images was not present. + # 1.3.21 Chat portrait support for Mark Pearce's PF2e Combat Tracker Images. Fixed links in dark mode chat messages. diff --git a/module.json b/module.json index 26f5531..b87a7bd 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.3.21", + "version": "1.3.22", "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.3.21.zip", + "download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.3.22.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 779b2cd..fc1ca8a 100644 --- a/scripts/dorako-ui.js +++ b/scripts/dorako-ui.js @@ -152,6 +152,8 @@ Hooks.once("init", async function () { CONFIG.ChatMessage.template = "modules/pf2e-dorako-ui/templates/base-chat-message.html"; + const combatImagesActive = game.modules.get("combat-tracker-images")?.active; + Handlebars.registerHelper("getSpeakerImage", function (message) { // const blind = message.whisper && message.blind; // if (blind) return "icons/svg/mystery-man.svg"; @@ -167,7 +169,9 @@ Hooks.once("init", async function () { } if (speaker.actor) { const actor = Actors.instance.get(speaker.actor); - combatantImg = actor.getFlag("combat-tracker-images", "trackerImage"); + combatantImg = combatImagesActive + ? actor.getFlag("combat-tracker-images", "trackerImage") + : null; actorImg = actor?.data.img; } } @@ -198,7 +202,9 @@ Hooks.once("init", async function () { } if (speaker.actor) { const actor = Actors.instance.get(speaker.actor); - combatantImg = actor.getFlag("combat-tracker-images", "trackerImage"); + combatantImg = combatImagesActive + ? actor.getFlag("combat-tracker-images", "trackerImage") + : null; actorImg = actor?.data.img; } } @@ -241,7 +247,9 @@ Hooks.once("init", async function () { } if (speaker.actor) { const actor = Actors.instance.get(speaker.actor); - combatantImg = actor.getFlag("combat-tracker-images", "trackerImage"); + combatantImg = combatImagesActive + ? actor.getFlag("combat-tracker-images", "trackerImage") + : null; actorImg = actor?.data.img; } }