Skip to content

Commit

Permalink
2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Apr 11, 2023
1 parent 4465ae6 commit 44bfa88
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.1.3

- (Module) Add support for Item Piles. The current implementation should also add support for other Svelte-based modules, but if that turns out to be too breaky I'll have to adjust.

# 2.1.2

- (Fix) Fixed an issue that messed up the token effects HUD when the new experimental setting was _not_ enabled
Expand Down
4 changes: 4 additions & 0 deletions modules/base-theme-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ for (const appName of [...baseThemeApplications]) {
// app.options.classes.push("dorako-ui");
// });

Hooks.on("renderSvelteApplication", (app) => {
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) => {
Expand Down
9 changes: 9 additions & 0 deletions modules/dark-theme-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@ for (const app of ["Application", ...baseThemePf2eSheets]) {
});
}

Hooks.on("renderSvelteApplication", (app) => {
const theme = game.settings.get("pf2e-dorako-ui", "theme.application-theme");
if (theme !== "dark-theme") return;
if (darkThemeIncompatibleApplications.includes(app?.constructor?.name)) return;
console.debug(`${MODULE_NAME} | render${app.constructor.name} | theme: ${theme}`);
app.element[0].classList.add("dorako-ui");
app.element[0].classList.add("dark-theme");
});

function markAsNativelyDarkTheme(app, html) {
let html0 = html[0];
console.debug(`${MODULE_NAME} | renderApplication (${app.constructor.name}) | forced dark theme`);
Expand Down
1 change: 1 addition & 0 deletions modules/pixi.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ const drawBG = (effectIcon, background, gridScale) => {
const updateEffectScales = (token) => {
// if (token?.actor?.size == "sm") return;
const numEffects = countEffects(token);
// debugger;
if (numEffects > 0 && token.effects.children.length > 0) {
const background = token.effects.children[0];
if (!(background instanceof PIXI.Graphics)) {
Expand Down
19 changes: 19 additions & 0 deletions sass/module/_item-piles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,22 @@
@include glass;
}
}

.item-piles-img-container {
@include gold-border;
border-radius: 3px;
margin: 3px;
}

.item-piles-app {
--item-piles-even-color: #7a79717a;
--item-piles-shadow-primary: var(--color-shadow-primary);
}

.dorako-ui.dark-theme {
--color-text-dark-secondary: #a9a798;
--item-piles-minor-inactive: rgb(15, 15, 15);
.item.active.underscore.item-piles-flexrow.item-piles-clickable-link {
border-bottom: 2px solid var(--tertiary-dark);
}
}
22 changes: 22 additions & 0 deletions styles/module-support.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/module-support.css.map

Large diffs are not rendered by default.

0 comments on commit 44bfa88

Please sign in to comment.