Skip to content

Commit

Permalink
1.11.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Feb 10, 2023
1 parent 1a0ffc0 commit 37a48c3
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.11.14

- (Refinement) When player-tags are enabled, remove the non-tag speaker name if it is identical to the tag. This conserves space.
- (New) New UX setting that animates whispers from players to GM to draw attention to them.

# 1.11.13

- (Fix) Fixed an issue where TinyMCE text editors were illegible while editing in dark theme.
Expand Down
4 changes: 4 additions & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@
"name": "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"
},
"animate-messages": {
"name": "Animate messages to draw attention to certain events?",
"hint": "Makes whispers from players to GM draw more attention"
},
"compact-ui": {
"name": "Enable Compact UI?",
"hint": "Resizes controls, and hides inactive controls and navigation elements unless hovered"
Expand Down
12 changes: 12 additions & 0 deletions modules/message-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ function injectAuthorName(html, messageData) {
playerNameElem.appendChild(document.createTextNode(playerName));
playerNameElem.classList.add("player-name");
playerNameElem.classList.add("header-meta");
if (playerName === messageData.alias) {
html.find(".message-sender").addClass("dorako-display-none");
}
messageSenderElem.append(playerNameElem);
}
}
Expand Down Expand Up @@ -354,6 +357,15 @@ function injectMessageTag(html, messageData) {
rolltype.text(i18n("pf2e-dorako-ui.text.whisper"));
messageMetadata.prepend(rolltype);
}

if (game.settings.get("pf2e-dorako-ui", "ux.animate-messages")) {
// Draw attention to direct whispers from players to GM
const isGmSpeaker = game.users.get(messageData.message.user)?.isGM;
const isGmTarget = game.users.get(whisperTargets?.[0])?.isGM;
if (!(isBlind || isSelf) && isWhisper && !isGmSpeaker && isGmTarget) {
html[0].classList.add("attention");
}
}
}
}

Expand Down
16 changes: 16 additions & 0 deletions modules/settings/ux-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class UXSettings extends SettingsMenuDorakoUI {
"remove-attack-info-from-damage-roll-messages",
"center-hotbar",
"enable-player-tags",
"animate-messages",
"rolltype-indication",
"start-sidebar-collapsed",
"start-navigation-collapsed",
Expand Down Expand Up @@ -91,6 +92,21 @@ export class UXSettings extends SettingsMenuDorakoUI {
}
},
},
"animate-messages": {
name: "pf2e-dorako-ui.settings.ux.animate-messages.name",
hint: "pf2e-dorako-ui.settings.ux.animate-messages.hint",
scope: "world",
type: Boolean,
default: true,
config: true,
requiresReload: false,
onChange: () => {
const messages = game.messages.filter((m) => m instanceof ChatMessage);
for (const message of messages) {
ui.chat.updateMessage(message);
}
},
},
"compact-ui": {
name: "pf2e-dorako-ui.settings.ux.compact-ui.name",
hint: "pf2e-dorako-ui.settings.ux.compact-ui.hint",
Expand Down
1 change: 1 addition & 0 deletions pf2e-dorako-ui.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
🔒
19 changes: 18 additions & 1 deletion sass/_messages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
// Chat messages can be popped out, .message is too general and applies to stuff in modules
.dorako-ui.message.chat-message {
@include sheet;
@include gold-border-shadow;
// @include gold-border-shadow; bad idea, chat merge makes messages drop shadows on each other
margin: 5px 3px 3px 3px;

&.whisper {
Expand Down Expand Up @@ -389,3 +389,20 @@
outline: 1px dashed #720073;
}
}

/* ----------------------------------------- */
/* Attention */
/* ----------------------------------------- */

.dorako-ui.message.chat-message.attention {
animation: wiggle ease-in-out infinite 1s alternate;
}

@keyframes wiggle {
0% {
transform: scale(0.9) translate(-15px);
}
100% {
transform: scale(0.9) translate(15px);
}
}
2 changes: 1 addition & 1 deletion sass/foundry/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
filter: none;
}

&:hover {
&:not(:disabled):hover {
border-color: var(--secondary-light);
box-shadow: 0px 0px 5px var(--secondary-light);
}
Expand Down
35 changes: 23 additions & 12 deletions styles/dorako-ui.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 37a48c3

Please sign in to comment.