Skip to content

Commit

Permalink
1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Jul 18, 2022
1 parent d89f097 commit a03e6e7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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!
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.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"
}
34 changes: 11 additions & 23 deletions scripts/dorako-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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;

Expand All @@ -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;
}
Expand All @@ -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;
}
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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 () {
Expand Down
4 changes: 4 additions & 0 deletions styles/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit a03e6e7

Please sign in to comment.