Skip to content

Commit

Permalink
1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Aug 12, 2022
1 parent 5a25f2b commit 4d5cade
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 97 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 1.5.2

Fixed close-button in Outlaws of Alkenstars premium module journals missing.

Fixed hidden tokens showing chat portraits.

Minor fixes to Narrator Tools and CGP compability.

Changed the blending mode for colored chat headers, should look better for bright, saturated colors that people often use.

Changed application header styling - it now reacts to what kind of sheet it is showing.

Updates to dark PC/Familiar sheet, courtesy of @Vesselchuck.

# 1.5.1

Added settings for disabling the portraits-react-to-degree-of-success feature and the use-user-avatar-as-portrait-fallback feature.
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.5.1",
"version": "1.5.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.5.1.zip",
"download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.5.2.zip",
"manifest": "https://github.com/Dorako/pf2e-dorako-ui/raw/main/module.json"
}
81 changes: 47 additions & 34 deletions scripts/dorako-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ Hooks.on("renderCombatTracker", addScalingToCombatTrackerAvatars);

// Chat cards
Hooks.on("renderChatMessage", (chatMessage, html, messageData) => {
if (chatMessage.flags["narrator-tools"]) {
return;
}

let html0 = html[0];

// console.log("renderChatMessage Hook");
Expand All @@ -138,7 +142,14 @@ Hooks.on("renderChatMessage", (chatMessage, html, messageData) => {
injectMessageTag(html, messageData);
injectWhisperParticipants(html, messageData);
injectAuthorName(html, messageData);
injectChatPortrait(html, getAvatar(chatMessage));

if (
game.settings.get("pf2e-dorako-ui", "hidePortraitWhenHidden") &&
chatMessage.getFlag("pf2e-dorako-ui", "wasTokenHidden")
) {
} else {
injectChatPortrait(html, getAvatar(chatMessage));
}
moveFlavorTextToContents(html);

const theme = game.settings.get("pf2e-dorako-ui", "theme");
Expand All @@ -160,8 +171,7 @@ Hooks.on("preCreateChatMessage", (message) => {
addAvatarsToFlags(message); // Really should be adding all of them, so you can change the setting and it will apply retroactively

message.data.update({
"flags.pf2eDorakoUi.tokenScale": message?.token?.data?.scale,
"flags.pf2eDorakoUi.wasTokenHidden": message?.token?.data?.hidden,
"flags.pf2e-dorako-ui.wasTokenHidden": message?.token?.data?.hidden,
});
});

Expand Down Expand Up @@ -247,15 +257,14 @@ function injectMessageTag(html, messageData) {
whisperTargets[0] === messageData.message.user;
const isRoll = messageData.message.roll !== undefined;

// Inject tag to the left of the timestamp
if (isBlind) {
rolltype.text("Secret");
messageMetadata.prepend(rolltype);
} else if (isSelf && whisperTargets[0]) {
rolltype.text(game.i18n.localize("CHAT.RollSelf"));
rolltype.text("Self roll");
messageMetadata.prepend(rolltype);
} else if (isRoll && isWhisper) {
rolltype.text(game.i18n.localize("CHAT.RollPrivate"));
rolltype.text("GM only");
messageMetadata.prepend(rolltype);
} else if (isWhisper) {
rolltype.text("Whisper");
Expand Down Expand Up @@ -369,7 +378,6 @@ function calcHeaderTextColor(html, message) {
}

function addAvatarsToFlags(message) {
// const main = game.settings.get("pf2e-dorako-ui", "insertSpeakerImage");
let combatantImg =
game.modules.get("combat-tracker-images")?.active && message.actor
? message.actor.getFlag("combat-tracker-images", "trackerImage")
Expand Down Expand Up @@ -399,26 +407,32 @@ function addAvatarsToFlags(message) {
}

message.data.update({
"flags.pf2eDorakoUi.userAvatar": userAvatar,
"flags.pf2eDorakoUi.combatantAvatar": combatantAvatar,
"flags.pf2eDorakoUi.tokenAvatar": tokenAvatar,
"flags.pf2eDorakoUi.actorAvatar": actorAvatar,
"flags.pf2e-dorako-ui.userAvatar": userAvatar,
"flags.pf2e-dorako-ui.combatantAvatar": combatantAvatar,
"flags.pf2e-dorako-ui.tokenAvatar": tokenAvatar,
"flags.pf2e-dorako-ui.actorAvatar": actorAvatar,
});
}

function getAvatar(message) {
const main = game.settings.get("pf2e-dorako-ui", "insertSpeakerImage");
let combatantAvatar = message.data.flags?.pf2eDorakoUi?.combatantAvatar?.image
? message.data.flags?.pf2eDorakoUi?.combatantAvatar
: null;
let tokenAvatar = message.data.flags?.pf2eDorakoUi?.tokenAvatar;
let actorAvatar = message.data.flags?.pf2eDorakoUi?.actorAvatar;

let combatantAvatar = message.getFlag("pf2e-dorako-ui", "combatantAvatar");
let tokenAvatar = message.getFlag("pf2e-dorako-ui", "tokenAvatar");
let actorAvatar = message.getFlag("pf2e-dorako-ui", "actorAvatar");
let userAvatar = game.settings.get("pf2e-dorako-ui", "use-user-avatar")
? message.data.flags?.pf2eDorakoUi?.userAvatar
? message.getFlag("pf2e-dorako-ui", "userAvatar")
: null;

if (combatantAvatar) return combatantAvatar;

if (
game.settings.get("pf2e-dorako-ui", "hidePortraitWhenHidden") &&
message.getFlag("pf2e-dorako-ui", "wasTokenHidden")
) {
return null;
}

return main == "token"
? tokenAvatar || actorAvatar || userAvatar
: actorAvatar || tokenAvatar || userAvatar;
Expand All @@ -438,7 +452,6 @@ Hooks.on("renderChatMessage", (message, b) => {
"small-creature-token-portrait-size"
);
let smallCorrection = avatar.isSmall ? 1.25 * smallScale : 1;
message.data.flags?.pf2eDorakoUi?.combatantAvatar?.image;
avatarElem?.setAttribute(
"style",
"transform: scale(" + avatar.scale * smallCorrection + ")"
Expand Down Expand Up @@ -617,7 +630,7 @@ Hooks.once("init", async () => {
hint: "Configure user avatars by right-clicking users in the lower left area of Foundry.",
scope: "world",
type: Boolean,
default: true,
default: false,
config: true,
onChange: () => {
debouncedReload();
Expand All @@ -629,7 +642,7 @@ Hooks.once("init", async () => {
hint: "Disable if your token art is fancy.",
scope: "client",
config: true,
default: true,
default: false,
type: Boolean,
onChange: () => {
debouncedReload();
Expand Down Expand Up @@ -795,7 +808,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-chat", {
name: "Theme chat?",
hint: "Applies theming to chat cards and sidebar content.",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -807,7 +820,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-navigation", {
name: "Theme scene navigation?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -819,7 +832,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-hotbar", {
name: "Theme the hotbar (macro bar)?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -831,7 +844,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-controls", {
name: "Theme scene controls?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -843,7 +856,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-token-hud", {
name: "Theme the token HUD?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -855,7 +868,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-effect-panel", {
name: "Theme the effect panel?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -867,7 +880,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-sidebar", {
name: "Theme the sidebar?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -879,7 +892,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-app-ui", {
name: "Theme app UI?",
hint: "This includes the player box, window headers, and similar",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -891,7 +904,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-combat-tracker", {
name: "Theme the combat tracker?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -903,7 +916,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-custom-hotbar", {
name: "Theme Custom Hotbar module?",
hint: "Set the 'core hotbar' to 1px 1px offset in Custom Hotbar settings.",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -915,7 +928,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-token-action-hud", {
name: "Theme Token Action HUD?",
hint: "Makes TAH more compact and fits in better with the rest of the UI.",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -927,7 +940,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-window-controls", {
name: "Theme Window Controls module?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -939,7 +952,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-combat-carousel", {
name: "Theme Combat Carousel?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand All @@ -951,7 +964,7 @@ Hooks.once("init", async () => {
game.settings.register("pf2e-dorako-ui", "skin-dice-tray", {
name: "Theme Dice Tray module?",
hint: "",
scope: "client",
scope: "World",
type: Boolean,
default: true,
config: true,
Expand Down
51 changes: 49 additions & 2 deletions styles/app-ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
background-color: var(--dorako-bg-current);
backdrop-filter: var(--dorako-vibrancy);
/*will-change: backdrop-filter;*/
transform: translate3d(0px, 0px, 0px);
/* transform: translate3d(0px, 0px, 0px); */
box-shadow: var(--glassy);
}

Expand Down Expand Up @@ -59,7 +59,7 @@

.window-app .window-content {
/* box-shadow: 0px 0px 10px black; */
box-shadow: var(--glassy);
/* box-shadow: var(--glassy); */
background: none;
background-color: var(--bg);
background-image: var(--pf2e-sheets-bg);
Expand Down Expand Up @@ -429,4 +429,51 @@
.window-app.story-sheet .window-header {
box-shadow: none;
background-color: transparent;
}


.window-app .window-content {
box-shadow: var(--gold-and-glow)
}

.app.window-app {
box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.5), var(--gold-and-glow);
}

.app.window-app .window-header {
box-shadow: var(--gold-and-glow);
transition: border-radius 0.25s;
}

.app.window-app.hazard .window-header {
background-color: #1C3531
}

.app.window-app.character .window-header {
background-color: #5D0E08
}

.app.window-app.npc .window-header {
background-color: #422d01
}


/* .app.window-app.minimized {
box-shadow: var(--glassy);
} */

.app.window-app.minimized .header {
box-shadow: none;
transition: border-radius 0.25s;
}

.dice-checks .window-content {
box-shadow: none;
}

.directory .directory-list .directory-item img {
box-shadow: var(--gold-and-glow), 0px 2px 10px rgba(0, 0, 0, 0.5);
margin: 3px;
border-radius: 5px;
background-color: var(--alt);
}
10 changes: 8 additions & 2 deletions styles/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -1445,13 +1445,13 @@ div#scrollToBottom:hover {
}

.message .message-header.dark-text {
background-blend-mode: luminosity;
background-blend-mode: multiply;
}

.message .message-header.dark-header-text {
color: black;
text-shadow: var(--pf2e-shadow-is-light);
background-blend-mode: luminosity;
background-blend-mode: multiply;
}

.message .message-header.light-header-text {
Expand Down Expand Up @@ -1614,6 +1614,7 @@ i[data-pf2-repost] {
font-size: small;
}

span[data-pf2-effect-area].with-repost,
span[data-pf2-check].with-repost {
border-right: 1px solid var(--color-border-dark-tertiary);
padding: .2em;
Expand Down Expand Up @@ -1642,4 +1643,9 @@ span[data-pf2-check].with-repost {
height: 1.2em;
border-radius: 3px;
box-shadow: var(--gold-and-glow)
}

#chat-log .message.narrator-description,
#chat-log .message.narrator-narrative {
border: none;
}
Loading

0 comments on commit 4d5cade

Please sign in to comment.