Skip to content

Commit

Permalink
1.11.24
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Feb 15, 2023
1 parent 789ff7d commit 28483b8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 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.24

- (Fix) Fixed an issue where Token Action Hud Core integration was not working as expected due to TAHC registering its settings much later than expected.
- (Fix) Fixed an issue where some Journals were dark-themed regardles of the dark-theme journals setting.

# 1.11.23

- (System) Blacklisted complex SWADE sheets from dark-theme.
Expand Down
2 changes: 2 additions & 0 deletions modules/dark-theme-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Hooks.on("renderJournalTextPageSheet", (app, html, data) => {
let frameHtml = journalFrame?.element;
if (!frameHtml || frameHtml.length == 0) return;
if (frameHtml[0].matches(premiumModuleSelector)) return;
const isDarkJournals = game.settings.get("pf2e-dorako-ui", "theme.enable-dark-theme-journals");
if (!isDarkJournals) return;
frameHtml.closest(".app").find(".journal-entry-content").addClass("dorako-ui dark-theme");
});

Expand Down
35 changes: 29 additions & 6 deletions modules/misc-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,8 @@ Hooks.once("ready", () => {
});

Hooks.once("ready", () => {
let tahModuleName = false;
if (game.modules.get("token-action-hud")?.active) tahModuleName = "token-action-hud";
if (game.modules.get("token-action-hud-core")?.active) tahModuleName = "token-action-hud-core";
if (!tahModuleName) return; // if no TAH is active, skip
if (game.settings.get(tahModuleName, "style") === "dorakoUI") return; // if setting is already right
if (!game.modules.get("token-action-hud")?.active) return;
if (game.settings.get("token-action-hud", "style") === "dorakoUI") return;
if (!game.settings.get("pf2e-dorako-ui", "tah-nag")) return; // if nag has been disabled
new Dialog({
title: "Dorako UI - Token Action HUD style",
Expand All @@ -64,7 +61,33 @@ Hooks.once("ready", () => {
enable: {
label: "Enable Dorako UI style",
callback: () => {
game.settings.set(tahModuleName, "style", "dorakoUI");
game.settings.set("token-action-hud", "style", "dorakoUI");
},
},
"dont-ask": {
label: "Do nothing, don't ask again",
callback: () => {
game.settings.set("pf2e-dorako-ui", "tah-nag", false);
},
},
},
default: "enable",
}).render(true);
});

Hooks.on("tokenActionHudCoreReady", () => {
if (game.settings.get("token-action-hud-core", "style") === "dorakoUI") return;
if (!game.settings.get("pf2e-dorako-ui", "tah-nag")) return; // if nag has been disabled
new Dialog({
title: "Dorako UI - Token Action HUD Core style",
content: `
<p>Token Action HUD Core ships with a setting that matches the style of Dorako UI.</p>
<p>Dorako UI can turn the setting on for you (recommended).</p>`,
buttons: {
enable: {
label: "Enable Dorako UI style",
callback: () => {
game.settings.set("token-action-hud-core", "style", "dorakoUI");
},
},
"dont-ask": {
Expand Down

0 comments on commit 28483b8

Please sign in to comment.