Skip to content

Commit

Permalink
v1.3.23
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed May 22, 2022
1 parent 20809f9 commit 35a6b4f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 1.3.23

Fixed damage-taken and healing-received messages not showing.

# 1.3.22

Fixed chat messages not showing up if PF2e Combat Tracker Images was not present.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Works great with:
- Polyglot
- Damage Log
- Combat Carousel
- PF2E Combat Tracker Images

Works well with:

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.3.22",
"version": "1.3.23",
"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.22.zip",
"download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.3.23.zip",
"manifest": "https://github.com/Dorako/pf2e-dorako-ui/raw/main/module.json"
}
32 changes: 28 additions & 4 deletions scripts/dorako-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ Hooks.once("init", async function () {
const speaker = message.speaker;
if (speaker) {
if (speaker.token) {
const token = game.scenes.get(speaker.scene).tokens?.get(speaker.token);
const token = game.scenes
.get(speaker.scene)
?.tokens?.get(speaker.token);
tokenImg = token?.data.img;
}
if (speaker.actor) {
Expand Down Expand Up @@ -197,7 +199,9 @@ Hooks.once("init", async function () {
const speaker = message.speaker;
if (speaker) {
if (speaker.token) {
const token = game.scenes.get(speaker.scene).tokens?.get(speaker.token);
const token = game.scenes
.get(speaker.scene)
?.tokens?.get(speaker.token);
tokenImg = token?.data.img;
}
if (speaker.actor) {
Expand Down Expand Up @@ -242,7 +246,9 @@ Hooks.once("init", async function () {
const speaker = message.speaker;
if (speaker) {
if (speaker.token) {
const token = game.scenes.get(speaker.scene).tokens?.get(speaker.token);
const token = game.scenes
.get(speaker.scene)
?.tokens?.get(speaker.token);
tokenImg = token?.data.img;
}
if (speaker.actor) {
Expand All @@ -261,6 +267,24 @@ Hooks.once("init", async function () {
return combatantImg || actorImg || tokenImg;
});

Handlebars.registerHelper("showHeader", function (message) {
const headerStyle = game.settings.get(
"pf2e-dorako-ui",
"insertSpeakerImage"
);

if (headerStyle === "none") return false;

const speaker = message.speaker;
if (
speaker &&
speaker.token &&
game.scenes.get(speaker.scene)?.tokens?.get(speaker.token)
) {
return true;
}
});

Handlebars.registerHelper("getHeaderStyle", function (message) {
const user = game.users.get(message.user);

Expand Down Expand Up @@ -314,7 +338,7 @@ Hooks.once("init", async function () {
}
});

Handlebars.registerHelper("getTitleStyle", function (message) {
Handlebars.registerHelper("isUsingHeaderTint", function (message) {
const headerStyle = game.settings.get("pf2e-dorako-ui", "headerStyle");
if (headerStyle === "tint") {
return true;
Expand Down
12 changes: 7 additions & 5 deletions templates/base-chat-message.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<li class="chat-message message flexcol {{cssClass}} {{baseTheme}} " data-message-id="{{message._id}}">
{{#if (getTitleStyle message)}}
<header class="message-header flexrow {{playerId message}}" style="background-color: {{getUserColor message}}">
{{else}}
<header class="message-header flexrow {{playerId message}}">
{{/if}}
{{#if (showHeader message)}}
{{#if (isUsingHeaderTint message)}}
<header class="message-header flexrow {{playerId message}}" style="background-color: {{getUserColor message}}">
{{else}}
<header class="message-header flexrow {{playerId message}}">
{{/if}}
{{#if (showSpeakerImage message)}}
<div class="portrait-and-name" style="display: flex; gap:5px">
<div class="portrait-wrapper">
Expand All @@ -21,6 +22,7 @@ <h4 class="message-sender">{{alias}}</h4>
{{/if}}
</span>
</header>
{{/if}}

{{#if isWhisper}}
<div class="whisper-to">{{localize 'CHAT.To'}}: {{whisperTo}}</div>
Expand Down

0 comments on commit 35a6b4f

Please sign in to comment.