Skip to content

Commit

Permalink
1.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Nov 8, 2022
1 parent c1cddc5 commit a042b83
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.8.2

Fixed display of DFCE 'in world' timestamps in messages.

Added a new option to remove attack information from damage rolls, to get a similar look to 1.7.4's combine-attacks-and-damage-rolls feature, when used with DFCE chat merge.

Fixed bug that caused action costs in restructured spell messages to render as numbers rather than icons.

# 1.8.1

Fixed display of combined messages with Avatars disabled.
Expand Down
3 changes: 3 additions & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
"dorako-ui.settings.combine-attack-and-damage-roll-messages.name": "Combine attack and damage roll messages?",
"dorako-ui.settings.combine-attack-and-damage-roll-messages.hint": "Makes damage roll messages take up less space by visually combining them with the attack",

"dorako-ui.settings.remove-attack-info-from-damage-roll-messages.name": "Remove attack info from damage roll messages?",
"dorako-ui.settings.remove-attack-info-from-damage-roll-messages.hint": "Makes damage rolls take up less space by removing redundant hit information. Intended to be used with DFCE chat-merge.",

"dorako-ui.settings.compact-ui.name": "Enable Compact UI?",
"dorako-ui.settings.compact-ui.hint": "Resizes controls, and hides inactive controls and navigation elements unless hovered",

Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"flags": {}
}
],
"version": "1.8.1",
"version": "1.8.2",
"compatibility": {
"minimum": "10",
"verified": "10"
Expand Down Expand Up @@ -59,6 +59,6 @@
],
"styles": ["styles/fonts.css"],
"scripts": ["scripts/dorako-ui.js"],
"download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.8.1.zip",
"download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.8.2.zip",
"manifest": "https://github.com/Dorako/pf2e-dorako-ui/releases/latest/download/module.json"
}
41 changes: 37 additions & 4 deletions scripts/dorako-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ function titleCase(string) {

// second return value is whether the first value can be styled as pf2e-icon
function getActionGlyph(actionCost) {
// console.log(actionCost);
if (actionCost === "1 to 3") return ["1 / 2 / 3", true];
if (actionCost === "1 or 2") return ["1 / 2", true];
if (actionCost === "2 or 3") return ["2 / 3", true];
if (actionCost.type == "action") {
if (actionCost.type === "action") {
return [actionCost.value, true];
} else if (actionCost.type == "reaction") return ["R", true];
else if (actionCost.type == "free") return ["F", true];
} else if (actionCost.type === "reaction") return ["R", true];
else if (actionCost.type === "free") return ["F", true];
else if (actionCost.length === 1) return [actionCost, true];
else return [actionCost, false];
}

Expand Down Expand Up @@ -272,6 +274,18 @@ Hooks.on("renderChatMessage", (chatMessage, html, messageData) => {
themeHeader(html, chatMessage);
});

Hooks.on("renderChatMessage", (chatMessage, html, messageData) => {
if (!game.settings.get("pf2e-dorako-ui", "remove-attack-info-from-damage-roll-messages")) return;

if (chatMessage?.isDamageRoll) {
html[0].classList.add("dorako-damage-roll");
let flavor = html.find(".flavor-text");
flavor.each(function () {
$(this).contents().eq(1).wrap("<span/>");
});
}
});

// // Combine attack and damage rolls from same source
// Hooks.on("renderChatMessage", (chatMessage, html, messageData) => {
// if (!game.settings.get("pf2e-dorako-ui", "combine-attack-and-damage-roll-messages")) return;
Expand Down Expand Up @@ -396,8 +410,15 @@ function themeHeader(html, message) {
let textColTheme = calcHeaderTextColor(html, message);
messageHeader.classList.add(textColTheme);

// some modules add different timestamps and hide the original, like dfce-simple-timestamp
let time = html.find("time")[0];
time.classList.add("header-meta");
if (time) {
time.classList.add("header-meta");
}
// let dfceTime = html.find(".dfce-simple-timestamp")[0];
// if (dfceTime) {
// dfceTime.classList.add("header-meta");
// }
}

function moveFlavorTextToContents(html) {
Expand Down Expand Up @@ -1205,6 +1226,18 @@ Hooks.once("init", async () => {
// },
// });

game.settings.register("pf2e-dorako-ui", "remove-attack-info-from-damage-roll-messages", {
name: i18n("dorako-ui.settings.remove-attack-info-from-damage-roll-messages.name"),
hint: i18n("dorako-ui.settings.remove-attack-info-from-damage-roll-messages.hint"),
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
debouncedReload();
},
});

game.settings.register("pf2e-dorako-ui", "compact-ui", {
name: i18n("dorako-ui.settings.compact-ui.name"),
hint: i18n("dorako-ui.settings.compact-ui.hint"),
Expand Down
16 changes: 13 additions & 3 deletions styles/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ button {




.dfce-cm-middle .dfce-simple-timestamp,
.dfce-cm-bottom .dfce-simple-timestamp,
.dfce-cm-middle>.message-header .sender-wrapper,
.dfce-cm-bottom>.message-header .sender-wrapper,
.dfce-cm-middle>.message-header>.message-metadata,
Expand All @@ -366,6 +367,8 @@ button {
display: none;
}



/*
#chat-log > .chat-message.message.flexcol :not(.chat-message.message.flexcol.dfce-cm-middle),
#chat-log > .chat-message.message.flexcol :not(.chat-message.message.flexcol.dfce-cm-bottom){
Expand Down Expand Up @@ -1254,7 +1257,7 @@ table.pf2-table td, table.pf2-table th {
}

.dfce-cm-middle .message-delete, .dfce-cm-bottom .message-delete {
top: 5px;
top: 12px;
}

.chat-message .message-header .message-sender {
Expand Down Expand Up @@ -1452,6 +1455,7 @@ div#scrollToBottom:hover {
text-shadow: none;
}

.dfce-simple-timestamp,
.header-meta {
border-radius: 3px;
padding: 2px;
Expand Down Expand Up @@ -1509,6 +1513,7 @@ div#scrollToBottom:hover {
color: white;
}

.message-header.light-header-text .dfce-simple-timestamp,
.message-header.light-header-text .header-meta {
color: white;
background-color: hsla(0, 0%, 50%, 40%);
Expand All @@ -1517,6 +1522,7 @@ div#scrollToBottom:hover {
}

.header-meta,
.dfce-simple-timestamp,
.message-header.dark-header-text .header-meta {
color: hsla(0, 0%, 20%, 100%);
background-color: hsla(0, 0%, 90%, 50%);
Expand Down Expand Up @@ -1754,7 +1760,7 @@ span[data-pf2-check].with-repost {
}


.chat-message.dorako-damage-roll .message-content {
/* .chat-message.dorako-damage-roll .message-content {
padding: 2px 5px 5px 5px;
}
Expand All @@ -1776,4 +1782,8 @@ span[data-pf2-check].with-repost {
.chat-message.dorako-ranged-combat p.action-content {
margin-top: 0px;
} */

.dorako-damage-roll .flavor-text>*:nth-child(-n+3) {
display: none;
}

0 comments on commit a042b83

Please sign in to comment.