Skip to content

Commit

Permalink
2.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Jul 16, 2023
1 parent fcc8079 commit 9b252ab
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 64 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 2.2.5

- (SWADE) Fix a regression causing non-journal application windows to not be tagged as "premium" and thus render with incorrect backgrounds
- (Maintenance) Make v11-style file path favorites be legible in dark theme
- (Refinement) Styled the 'jump-to' chat button
- (Maintenance) Refactored rolltype-indication setting into a toggle
- (Maintenance) Removed the 'experimental' wording from the adjust-effect-hud setting and made it default to true

# 2.2.4

- (New) Adds a UX setting to remove compendium banner images in the sidebar
Expand Down
14 changes: 4 additions & 10 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
},
"adjust-token-effects-hud": {
"name": "Adjust token effects HUD?",
"hint": "(Experimental) Makes effects circular and arranges them outside the token, or on the token ring for larger tokens"
"hint": "Makes effects circular and arranges them outside the token, or on the token ring for larger tokens"
},
"remove-attack-info-from-damage-roll-messages": {
"name": "Remove attack info from damage roll messages?",
Expand Down Expand Up @@ -184,15 +184,9 @@
"name": "Enable player tags?",
"hint": "Adds a tag containing the name of the player next to the speaker"
},
"rolltype-indication": {
"name": "Rolltype indication mode",
"hint": "Configure user avatars by right-clicking users in the lower left area of Foundry",
"choice": {
"tags": "Tags",
"bg-color": "Background color tint",
"both": "Tags and background color",
"none": "Disabled"
}
"enable-rolltype-indication": {
"name": "Enable rolltype tag?",
"hint": "Adds a tag containing the type of roll to chat messages"
}
},
"misc": {
Expand Down
2 changes: 1 addition & 1 deletion modules/base-theme-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { baseThemeApplications, baseThemePf2eSheets, MODULE_NAME, premiumModuleS
// Add .dorako-ui to all always-styled applications (Does not include pf2e sheets)
for (const appName of [...baseThemeApplications]) {
Hooks.on("render" + appName, (app, html, data) => {
// if (app.constructor.name.startsWith("SWPF")) return; // SWPFCompendiumTOC, SWPFSheet
if (app.constructor.name.startsWith("SWPF")) return; // SWPFCompendiumTOC, SWPFSheet
const excludeString = game.settings.get("pf2e-dorako-ui", "customization.excluded-applications");
if (excludeString.toLowerCase().includes(appName.toLowerCase())) {
console.debug(
Expand Down
71 changes: 35 additions & 36 deletions modules/message-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,44 +384,43 @@ function injectAuthorName(html, messageData) {
}

function injectMessageTag(html, messageData) {
const setting = game.settings.get("pf2e-dorako-ui", "ux.rolltype-indication");
if (setting == "none") {
const setting = game.settings.get("pf2e-dorako-ui", "ux.enable-rolltype-indication");
if (setting == false) {
return;
} else if (setting == "tags" || setting == "both") {
const messageMetadata = html.find(".message-metadata");

const rolltype = $("<span>");
rolltype.addClass("rolltype");
rolltype.addClass("header-meta");

const whisperTargets = messageData.message.whisper;

const isBlind = messageData.message.blind;
const isWhisper = whisperTargets?.length > 0;
const isSelf = isWhisper && whisperTargets.length === 1 && whisperTargets[0] === messageData.message.user;
const isRoll = messageData.message.rolls !== undefined;

if (isBlind) {
rolltype.text(i18n("pf2e-dorako-ui.text.secret"));
messageMetadata.prepend(rolltype);
} else if (isSelf && whisperTargets[0]) {
rolltype.text(i18n("pf2e-dorako-ui.text.self-roll"));
messageMetadata.prepend(rolltype);
} else if (isRoll && isWhisper) {
rolltype.text(i18n("pf2e-dorako-ui.text.gm-only"));
messageMetadata.prepend(rolltype);
} else if (isWhisper) {
rolltype.text(i18n("pf2e-dorako-ui.text.whisper"));
messageMetadata.prepend(rolltype);
}
}
const messageMetadata = html.find(".message-metadata");

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");
}
const rolltype = $("<span>");
rolltype.addClass("rolltype");
rolltype.addClass("header-meta");

const whisperTargets = messageData.message.whisper;

const isBlind = messageData.message.blind;
const isWhisper = whisperTargets?.length > 0;
const isSelf = isWhisper && whisperTargets.length === 1 && whisperTargets[0] === messageData.message.user;
const isRoll = messageData.message.rolls !== undefined;

if (isBlind) {
rolltype.text(i18n("pf2e-dorako-ui.text.secret"));
messageMetadata.prepend(rolltype);
} else if (isSelf && whisperTargets[0]) {
rolltype.text(i18n("pf2e-dorako-ui.text.self-roll"));
messageMetadata.prepend(rolltype);
} else if (isRoll && isWhisper) {
rolltype.text(i18n("pf2e-dorako-ui.text.gm-only"));
messageMetadata.prepend(rolltype);
} else if (isWhisper) {
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
6 changes: 6 additions & 0 deletions modules/premium-module-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@ Hooks.on("renderApplication", (app, html, data) => {
html[0].classList.add("dorako-ui");
}
});

Hooks.on("renderSWPFCompendiumTOC", (app, html, appName) => {
console.debug(`${MODULE_NAME} | ${appName} starts with 'SWPF' => add .premium`);
html[0].classList.add("premium");
// html.closest(".app").find(".journal-entry-content").addClass(".premium");
});
26 changes: 10 additions & 16 deletions modules/settings/ux-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export class UXSettings extends SettingsMenuDorakoUI {
"no-logo",
"compact-ui",
"remove-attack-info-from-damage-roll-messages",
"center-hotbar",
"enable-rolltype-indication",
"enable-player-tags",
"animate-messages",
"rolltype-indication",
"center-hotbar",
"start-sidebar-collapsed",
"start-navigation-collapsed",
"adjust-token-effects-hud",
"animate-messages",
"no-compendium-banner-images",
];

Expand All @@ -44,9 +44,9 @@ export class UXSettings extends SettingsMenuDorakoUI {
"adjust-token-effects-hud": {
name: "pf2e-dorako-ui.settings.ux.adjust-token-effects-hud.name",
hint: "pf2e-dorako-ui.settings.ux.adjust-token-effects-hud.hint",
scope: "client",
scope: "world",
type: Boolean,
default: false,
default: true,
config: true,
requiresReload: true,
},
Expand Down Expand Up @@ -227,19 +227,13 @@ export class UXSettings extends SettingsMenuDorakoUI {
}
},
},
"rolltype-indication": {
name: "pf2e-dorako-ui.settings.ux.rolltype-indication.name",
hint: "pf2e-dorako-ui.settings.ux.rolltype-indication.hint",
"enable-rolltype-indication": {
name: "pf2e-dorako-ui.settings.ux.enable-rolltype-indication.name",
hint: "pf2e-dorako-ui.settings.ux.enable-rolltype-indication.hint",
scope: "client",
type: String,
default: "both",
type: Boolean,
default: true,
config: true,
choices: {
tags: "pf2e-dorako-ui.settings.ux.rolltype-indication.choice.tags",
"bg-color": "pf2e-dorako-ui.settings.ux.rolltype-indication.choice.bg-color",
both: "pf2e-dorako-ui.settings.ux.rolltype-indication.choice.both",
none: "pf2e-dorako-ui.settings.ux.rolltype-indication.choice.none",
},
requiresReload: false,
onChange: () => {
const messages = game.messages.filter((m) => m instanceof ChatMessage);
Expand Down
4 changes: 4 additions & 0 deletions sass/foundry/_application-dark.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.dorako-ui.dark-theme {
&.filepicker .favorites .path {
background: none;
}

&.pf2e.item.sheet form section.sheet-body .item-description .descriptions .editor a {
&.add-gm-notes,
&.editor-edit {
Expand Down
14 changes: 14 additions & 0 deletions sass/foundry/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,17 @@ section.chat-sidebar {
}
}
}

#sidebar .dorako-ui .jump-to-bottom {
@include glass;
@include quick-transition;
margin-left: 5px;
width: 288px;
text-shadow: 0px 0px 3px black;
background-color: var(--glass-bg-dark);

&:hover {
background-color: var(--primary-light);
text-shadow: 0px 0px 8px var(--color-shadow-highlight);
}
}
20 changes: 20 additions & 0 deletions styles/dorako-ui.css

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

2 changes: 1 addition & 1 deletion styles/dorako-ui.css.map

Large diffs are not rendered by default.

0 comments on commit 9b252ab

Please sign in to comment.