Skip to content

Commit

Permalink
2.11.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Oct 31, 2023
1 parent 8b235d9 commit f9c656c
Show file tree
Hide file tree
Showing 14 changed files with 339 additions and 312 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.11.11

- (Refinement) Added Foundry 2 styling for Speaking As.
- (Maintenance) Updated Foundry 2 styling for new version of Dice Tray.
- (Refinement) Impoved Foundry 2 styling for Journals using the CRB-styled journal setting.
- (Refinement) Rewrote exclusion logic to be more robust, so it doesn't falsely exclude things like the Camping sheet from the Kingmaker Tools (Unofficial) module.

# 2.11.10

- (Refinement) Added Foundry 2 styling for Item Piles.
Expand Down
29 changes: 3 additions & 26 deletions esmodules/dorako-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ for (const appName of [...baseThemeApplications]) {
if (theme === "no-theme" || theme === "foundry2-theme") return;
const excludeString =
game.settings.get("pf2e-dorako-ui", "customization.excluded-applications") + ", MonksEnhancedJournal";
if (excludeString.toLowerCase().includes(appName.toLowerCase())) {
const excludeList = excludeString.split(/[\s,]+/);
if (excludeList.includes(app.constructor.name)) {
console.debug(
`${MODULE_NAME} | render${app.constructor.name} | is included in excluded applications string ${excludeString} => do not add .dorako-ui`
);
Expand All @@ -21,36 +22,12 @@ for (const appName of [...baseThemeApplications]) {
});
}

// Hooks.on("renderMerchantApp", (app, html, data) => {
// let html0 = html[0];
// html0.classList.add("dorako-ui");
// console.debug(`${MODULE_NAME} | LOOK AT ME`);
// console.log({ app });
// console.log({ html });
// console.log({ data });
// app.options.classes.push("dorako-ui");
// });

Hooks.on("renderSvelteApplication", (app) => {
const theme = game.settings.get("pf2e-dorako-ui", "theme.application-theme");
if (theme === "no-theme" || theme === "foundry2-theme") return;
app.element[0].classList.add("dorako-ui");
});

// // Add .dorako-ui to all whitelisted Applications
// for (const app of [...baseThemeApplications]) {
// Hooks.on("render" + app, (app, html, data) => {
// let html0 = html[0];
// const theme = game.settings.get("pf2e-dorako-ui", "theme.application-theme");
// if (theme === "no-theme") {
// console.debug(`${MODULE_NAME} | render${app.constructor.name} | theme: ${theme} => do not add .dorako-ui`);
// return;
// }
// console.debug(`${MODULE_NAME} | baseThemeApplications | render${app.constructor.name} => add .dorako-ui`);
// html0.classList.add("dorako-ui");
// });
// }

// TAH Core
Hooks.on("renderTokenActionHud", (app, html, data) => {
if (
Expand Down Expand Up @@ -177,7 +154,7 @@ for (const appName of ["CharacterSheetPF2e", "VehicleSheetPF2e"]) {
// Re-organize NPC sheets, do not apply base styling to selects or input fields
Hooks.on("renderNPCSheetPF2e", (app, html, data) => {
const theme = game.settings.get("pf2e-dorako-ui", "theme.application-theme");
if (theme === "no-theme" || theme === "foundry2-theme") {
if (theme === "no-theme") {
console.debug(`${MODULE_NAME} | render${app.constructor.name} | theme: ${theme} => do not add .dorako-ui`);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion esmodules/dorako-ux/customization.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,6 @@ for (const appName of ["JournalSheet", "JournalPageSheet"]) {
const isDalvyn = game.settings.get("pf2e-dorako-ui", "misc.skin-crb-journal");
if (!isDalvyn) return;
if (app.id.includes("Compendium-pf2e-criticaldeck")) return;
html.closest(".app").find(".journal-entry-content").addClass("dorako-ui dalvyn-journal");
html.closest(".app").find(".journal-entry-content").addClass("dalvyn-journal");
});
}
15 changes: 9 additions & 6 deletions esmodules/foundry2-theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ for (const appName of [...baseThemeApplications]) {
const theme = game.settings.get("pf2e-dorako-ui", "theme.application-theme");
if (theme !== "foundry2-theme") return;
const excludeString =
game.settings.get("pf2e-dorako-ui", "customization.excluded-applications") + "VehicleSheetPF2e" + "HUD";
if (excludeString.toLowerCase().includes(appName.toLowerCase())) {
game.settings.get("pf2e-dorako-ui", "customization.excluded-applications") + ", VehicleSheetPF2e, HUD";
const excludeList = excludeString.split(/[\s,]+/);
if (excludeList.includes(app.constructor.name)) {
console.debug(
`${MODULE_NAME} | render${app.constructor.name} | is included in excluded applications string ${excludeString} => do not add .foundry2`
);
Expand All @@ -27,7 +28,6 @@ for (const appName of [...baseThemeApplications]) {

Hooks.on("renderApplication", (app, html, data) => {
let html0 = html[0];
// if (html0.classList.contains("dialog")) return;
if (html0.classList.contains("editable")) return;
if (!html0.classList.contains("window-app")) return;
if (isPremiumApplication(app, html, data, app.constructor.name)) return;
Expand All @@ -37,7 +37,8 @@ Hooks.on("renderApplication", (app, html, data) => {
}
const excludeString =
game.settings.get("pf2e-dorako-ui", "customization.excluded-applications") + ", MonksEnhancedJournal";
if (excludeString.toLowerCase().includes(app.constructor.name.toLowerCase())) {
const excludeList = excludeString.split(/[\s,]+/);
if (excludeList.includes(app.constructor.name)) {
console.debug(
`${MODULE_NAME} | render${app.constructor.name} | is included in excluded applications string ${excludeString} => do not add .foundry2`
);
Expand Down Expand Up @@ -86,7 +87,8 @@ Hooks.on("renderTokenActionHud", (app, html, data) => {
return;
}
const excludeString = game.settings.get("pf2e-dorako-ui", "customization.excluded-applications");
if (excludeString.toLowerCase().includes("TokenActionHud".toLowerCase())) {
const excludeList = excludeString.split(/[\s,]+/);
if (excludeList.includes("TokenActionHud")) {
console.debug(
`${MODULE_NAME} | render${app.constructor.name} | is included in excluded applications string ${excludeString} => do not add .foundry2`
);
Expand All @@ -102,7 +104,8 @@ Hooks.on("renderTokenBar", (app, html, data) => {
return;
}
const excludeString = game.settings.get("pf2e-dorako-ui", "customization.excluded-applications");
if (excludeString.toLowerCase().includes("TokenBar".toLowerCase())) {
const excludeList = excludeString.split(/[\s,]+/);
if (excludeList.includes("TokenBar")) {
console.debug(
`${MODULE_NAME} | render${app.constructor.name} | is included in excluded applications string ${excludeString} => do not add .foundry2`
);
Expand Down
44 changes: 0 additions & 44 deletions esmodules/misc-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,50 +101,6 @@ Hooks.on("tokenActionHudCoreReady", () => {
}).render(true);
});

// If misc.skin-crb-journal is on, all non-premium module journals should have .dalvyn-journal
// Hooks.on("renderApplication", (app, html, data) => {
// let html0 = html[0];
// if (!(html0.classList.contains("journal-entry") || html0.classList.contains("monks-enhanced-journal"))) return;
// if (html0.matches(premiumModuleSelector)) {
// console.debug(
// `${MODULE_NAME} | render${app.constructor.name} | matches premiumModuleSelector => do not add .dorako-ui`
// );
// return;
// }
// if (html[0].id.includes("JournalSheetPF2e-Compendium-pf2e-criticaldeck")) return;
// const isDalvyn = game.settings.get("pf2e-dorako-ui", "misc.skin-crb-journal");
// if (!isDalvyn) return;
// console.debug(
// `${MODULE_NAME} | render${app.constructor.name} | is .journal-entry and skin-crb-journal = true => add .dalvyn-journal`
// );
// html0.classList.add("dalvyn-journal");
// });

// Hooks.on("renderJournalTextPageSheet", (app, html, data) => {
// const isDalvyn = game.settings.get("pf2e-dorako-ui", "misc.skin-crb-journal");
// if (!isDalvyn) return;
// if (html[0].id.includes("JournalSheetPF2e-Compendium-pf2e-criticaldeck")) return;
// html[0].classList.add("dorako-ui");
// html[0].classList.add("dalvyn-journal");
// });

// // Add .dorako-ui.dark-theme to the page if it is not a page included in a premium module-styled journal
// Hooks.on("renderJournalTextPageSheet", (app, html, data) => {
// let journalFrame = app?.object?.parent?.sheet;
// if (!journalFrame) return;
// let frameHtml = journalFrame?.element;
// if (!frameHtml || frameHtml.length == 0) return;
// if (frameHtml[0].matches(premiumModuleSelector)) return;
// const isDalvyn = game.settings.get("pf2e-dorako-ui", "misc.skin-crb-journal");
// if (!isDalvyn) return;
// console.debug(`${MODULE_NAME} | render${app.constructor.name} | skin-crb-journal = true => add .dalvyn-journal`);
// html[0].classList.add("dalvyn-journal");
// frameHtml.closest(".app").find(".journal-entry-content").addClass("dorako-ui");
// const isDarkJournals = game.settings.get("pf2e-dorako-ui", "theme.enable-dark-theme-journals");
// if (!isDarkJournals) return;
// frameHtml.closest(".app").find(".journal-entry-content").addClass("dark-theme");
// });

// Add debug buttons
for (const application of ["Application", ...baseThemePf2eSheets]) {
Hooks.on("render" + application, (app, html, data) => {
Expand Down
60 changes: 60 additions & 0 deletions sass/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,63 @@ $adjusted-lower: #cc3311 !default;
--bg: var(--glass-bg-dark);
--half-transparent: rgba(255, 255, 255, 0.5);
}

/* ----------------------------------------- */
/* Damage colors */
/* ----------------------------------------- */

.dorako-ui.dark-theme .damage,
.foundry2-pc .damage,
.foundry2 .damage {
--color-bg-acid: rgba(32, 194, 32, 0.125); // adjusted
--color-bg-bleed: rgba(207, 28, 58, 0.125); // adjusted
--color-bg-chaotic: rgba(221, 26, 221, 0.125); // adjusted
--color-bg-cold: rgba(72, 72, 198, 0.125); // adjusted
--color-bg-electricity: rgba(221, 167, 30, 0.125); // adjusted
--color-bg-evil: rgba(133, 45, 195, 0.125); // adjusted
--color-bg-fire: rgba(229, 93, 39, 0.125); // adjusted
--color-bg-force: rgba(177, 77, 249, 0.125); // adjusted
--color-bg-good: rgba(157, 115, 10, 0.125); // adjusted
--color-bg-lawful: rgba(123, 85, 28, 0.125); // adjusted
--color-bg-mental: rgba(66, 66, 189, 0.125); // adjusted
--color-bg-physical: rgba(132, 132, 132, 0.125); // adjusted
--color-bg-poison: rgba(147, 178, 93, 0.125); // adjusted
--color-bg-sonic: rgba(28, 217, 217, 0.125); // adjusted
--color-bg-spirit: rgba(147, 142, 189, 0.125); // adjusted
--color-bg-vitality: rgba(255, 255, 224, 0.125);
--color-bg-void: rgb(81, 21, 78, 0.125); // adjusted
--color-border-acid: #12a812; // adjusted
--color-border-bleed: #d11c3b; // adjusted
--color-border-chaotic: #d311d3; // adjusted
--color-border-cold: #2f2fa6;
--color-border-electricity: yellow; // adjusted
--color-border-evil: rgb(126, 48, 181); // adjusted
--color-border-fire: #cd4a17; // adjusted
--color-border-force: #9222e2; // adjusted
--color-border-good: #dcb85f; // adjusted
--color-border-lawful: #97743f; // adjusted
--color-border-mental: rgb(63, 63, 182); // adjusted
--color-border-physical: #737272; // adjusted
--color-border-poison: #9aba64; // adjusted
--color-border-sonic: rgb(30, 202, 202); // adjusted
--color-border-spirit: #5a5585;
--color-border-vitality: #ffffe0;
--color-border-void: rgb(122, 38, 117); // adjusted
--color-text-acid: #34aa34; // adjusted
--color-text-bleed: #b0162f; // adjusted
--color-text-chaotic: #b71ab7; // adjusted
--color-text-cold: #3a3ac5; // adjusted
--color-text-electricity: #e7b22b; // adjusted
--color-text-evil: #594566; // adjusted
--color-text-fire: #882700; // adjusted
--color-text-force: #8321ca; // adjusted
--color-text-good: #c79b2b; // adjusted
--color-text-lawful: white; // adjusted
--color-text-mental: #3b3bad; // adjusted
--color-text-physical: #a0a0a0; // adjusted
--color-text-poison: #657d3f; // adjusted
--color-text-sonic: #21c2c2; // adjusted
--color-text-spirit: #827dac; // adjusted
--color-text-vitality: #ffffa0;
--color-text-void: rgb(122, 38, 117); // adjusted
}
64 changes: 3 additions & 61 deletions sass/foundry2-theme/pf2e-system/_messages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/* ----------------------------------------- */
.foundry2.chat-message {
background: unset;
// --gold-and-glow: transparent;
@include f2-app;
--color-text-light-6: var(--color-cool-4);
--color-text-dark-secondary: var(--color-light-4); // 5 is too dark on colored message backgrounds
Expand Down Expand Up @@ -206,6 +205,7 @@
text-shadow: 0px 1px 1px black;
padding-bottom: 5px;
margin-bottom: 2px;
box-shadow: none;

a {
@include quick-transition;
Expand Down Expand Up @@ -233,7 +233,6 @@
@include f2-app;
background-color: color-mix(in srgb, var(--header-color) 50%, transparent);
border-color: color-mix(in srgb, var(--header-color) 50%, white);
// box-shadow: unset;
}

// &.light-header-text {
Expand Down Expand Up @@ -315,70 +314,13 @@
@include f2-app;
}
}

&.chat-message .message-content .damage-taken button.revert-damage {
@include f2-button-warm;
}

&.chat-message.emote > .message-content p.action-content img {
@include f2-app;
border-color: var(--color-warm-1);
}
}

/* ----------------------------------------- */
/* Damage colors */
/* ----------------------------------------- */

.foundry2-pc .damage,
.foundry2 .damage {
--color-bg-acid: rgba(32, 194, 32, 0.125); // adjusted
--color-bg-bleed: rgba(207, 28, 58, 0.125); // adjusted
--color-bg-chaotic: rgba(221, 26, 221, 0.125); // adjusted
--color-bg-cold: rgba(72, 72, 198, 0.125); // adjusted
--color-bg-electricity: rgba(221, 167, 30, 0.125); // adjusted
--color-bg-evil: rgba(133, 45, 195, 0.125); // adjusted
--color-bg-fire: rgba(229, 93, 39, 0.125); // adjusted
--color-bg-force: rgba(177, 77, 249, 0.125); // adjusted
--color-bg-good: rgba(157, 115, 10, 0.125); // adjusted
--color-bg-lawful: rgba(123, 85, 28, 0.125); // adjusted
--color-bg-mental: rgba(66, 66, 189, 0.125); // adjusted
--color-bg-physical: rgba(132, 132, 132, 0.125); // adjusted
--color-bg-poison: rgba(147, 178, 93, 0.125); // adjusted
--color-bg-sonic: rgba(28, 217, 217, 0.125); // adjusted
--color-bg-spirit: rgba(147, 142, 189, 0.125); // adjusted
--color-bg-vitality: rgba(255, 255, 224, 0.125);
--color-bg-void: rgb(81, 21, 78, 0.125); // adjusted
--color-border-acid: #12a812; // adjusted
--color-border-bleed: #d11c3b; // adjusted
--color-border-chaotic: #d311d3; // adjusted
--color-border-cold: #2f2fa6;
--color-border-electricity: yellow; // adjusted
--color-border-evil: rgb(126, 48, 181); // adjusted
--color-border-fire: #cd4a17; // adjusted
--color-border-force: #9222e2; // adjusted
--color-border-good: #dcb85f; // adjusted
--color-border-lawful: #97743f; // adjusted
--color-border-mental: rgb(63, 63, 182); // adjusted
--color-border-physical: #737272; // adjusted
--color-border-poison: #9aba64; // adjusted
--color-border-sonic: rgb(30, 202, 202); // adjusted
--color-border-spirit: #5a5585;
--color-border-vitality: #ffffe0;
--color-border-void: rgb(122, 38, 117); // adjusted
--color-text-acid: #34aa34; // adjusted
--color-text-bleed: #b0162f; // adjusted
--color-text-chaotic: #b71ab7; // adjusted
--color-text-cold: #3a3ac5; // adjusted
--color-text-electricity: #e7b22b; // adjusted
--color-text-evil: #594566; // adjusted
--color-text-fire: #882700; // adjusted
--color-text-force: #8321ca; // adjusted
--color-text-good: #c79b2b; // adjusted
--color-text-lawful: white; // adjusted
--color-text-mental: #3b3bad; // adjusted
--color-text-physical: #a0a0a0; // adjusted
--color-text-poison: #657d3f; // adjusted
--color-text-sonic: #21c2c2; // adjusted
--color-text-spirit: #827dac; // adjusted
--color-text-vitality: #ffffa0;
--color-text-void: rgb(122, 38, 117); // adjusted
}
18 changes: 18 additions & 0 deletions sass/module-support/_better-module-formulas.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.foundry2.chat-message {
.dice-tooltip .dice-rolls .roll {
color: var(--color-light-3);
&.die {
color: black;
text-shadow: none;
&.success,
&.max {
color: var(--degree-success-critical);
text-shadow: 0px 1px 2px black;
}
&.min {
color: var(--degree-failure-critical);
text-shadow: 0px 1px 2px black;
}
}
}
}
Loading

0 comments on commit f9c656c

Please sign in to comment.