Skip to content

Commit

Permalink
2.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Jul 25, 2023
1 parent 79e1dfc commit 500d8d4
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 58 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.3.5

- (Refinement) Added a new section in settings related to customizing other modules. The section only shows if you have a module with supported customizations active.
- (Refinement) Added a setting to customize whether PF2e Interactive Tooltip uses a monochrome or colorized suite of icons

# 2.3.4

- (Maintenance) Update styling so inline checks are legible in dark theme once again
Expand Down
10 changes: 10 additions & 0 deletions languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,16 @@
"name": "Custom CSS",
"hint": "Write CSS in an external editor and paste it in here"
}
},
"external-module": {
"name": "External Module Settings",
"label": "",
"hint": "Adjustments for how other modules are affected by Dorako UI",

"colorize-idle-hud": {
"name": "Colorize PF2e Interactive Token Tooltip?",
"hint": "Applies a colorized theme to the icons in the main tooltip"
}
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions modules/misc-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,4 +287,25 @@ Hooks.on("renderSettingsConfig", (app, html, data) => {
`<p class="notes">${i18n("pf2e-dorako-ui.settings.customization.hint")}</p>`
)
.insertBefore($('[name="pf2e-dorako-ui.customization.excluded-applications"]').parents("div.form-group:first"));

const isIdleHudEnabled = game.modules.get("pf2e-token-hud")?.active;

if (isIdleHudEnabled) {
$("<div>")
.addClass("form-group dorako-ui settings-header")
.html(
i18n("pf2e-dorako-ui.settings.external-module.name") +
`<p class="notes">${i18n("pf2e-dorako-ui.settings.external-module.hint")}</p>`
)
.insertBefore($('[name="pf2e-dorako-ui.external-module.colorize-idle-hud"]').parents("div.form-group:first"));
} else {
$("div[data-setting-id*=external-module]").addClass("dorako-display-none");
}
});

Hooks.on("renderHUD", (app, html, data) => {
const isColorized = game.settings.get("pf2e-dorako-ui", "external-module.colorize-idle-hud");
if (!isColorized) return;
let html0 = html[0];
html0.classList.add("colorized");
});
24 changes: 24 additions & 0 deletions modules/settings/external-module-settings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { SettingsMenuDorakoUI } from "./menu.js";

export class ExternalModuleSettings extends SettingsMenuDorakoUI {
static namespace = "external-module";

static SETTINGS = ["colorize-idle-hud"];

rerenderChatMessages() {}

static get settings() {
return {
"colorize-idle-hud": {
name: "pf2e-dorako-ui.settings.external-module.colorize-idle-hud.name",
hint: "pf2e-dorako-ui.settings.external-module.colorize-idle-hud.hint",
scope: "client",
type: Boolean,
default: false,
config: true,
requiresReload: false,
onChange: (value) => {},
},
};
}
}
38 changes: 2 additions & 36 deletions modules/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { UXSettings } from "./ux-settings.js";
import { AvatarSettings } from "./avatar-settings.js";
import { MiscSettings } from "./misc-settings.js";
import { CustomizationSettings } from "./customization-settings.js";
import { ExternalModuleSettings } from "./external-module-settings.js";

function injectCSS(filename) {
const head = document.getElementsByTagName("head")[0];
Expand Down Expand Up @@ -49,47 +50,12 @@ Hooks.once("init", async () => {
type: String,
});

// game.settings.registerMenu("pf2e-dorako-ui", "theme", {
// name: "pf2e-dorako-ui.settings.theme.name",
// label: "pf2e-dorako-ui.settings.theme.label",
// hint: "pf2e-dorako-ui.settings.theme.hint",
// icon: "fas fa-adjust",
// type: ThemeSettings,
// restricted: false,
// });
ThemeSettings.registerSettings();

// game.settings.registerMenu("pf2e-dorako-ui", "avatar", {
// name: "pf2e-dorako-ui.settings.avatar.name",
// label: "pf2e-dorako-ui.settings.avatar.label",
// hint: "pf2e-dorako-ui.settings.avatar.hint",
// icon: "fas fa-circle-user",
// type: AvatarSettings,
// restricted: false,
// });
AvatarSettings.registerSettings();

// game.settings.registerMenu("pf2e-dorako-ui", "ux", {
// name: "pf2e-dorako-ui.settings.ux.name",
// label: "pf2e-dorako-ui.settings.ux.label",
// hint: "pf2e-dorako-ui.settings.ux.hint",
// icon: "fas fa-sliders",
// type: UXSettings,
// restricted: false,
// });
UXSettings.registerSettings();

// game.settings.registerMenu("pf2e-dorako-ui", "misc", {
// name: "pf2e-dorako-ui.settings.misc.name",
// label: "pf2e-dorako-ui.settings.misc.label",
// hint: "pf2e-dorako-ui.settings.misc.hint",
// icon: "fas fa-question-circle",
// type: MiscSettings,
// restricted: false,
// });
MiscSettings.registerSettings();

CustomizationSettings.registerSettings();
ExternalModuleSettings.registerSettings();

util.debug("registered settings");

Expand Down
3 changes: 2 additions & 1 deletion sass/module/_pf2e-idle-hud.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

.sidebar.spells .entry .spell .details .extras .actions {
text-shadow: 0px 1px 1px black, 0px 1px 15px white;
color: #f8f8f8;
}

.distance,
Expand Down Expand Up @@ -142,7 +143,7 @@
}

/* Symon Custom CSS */
#pf2e-token-hud.dorako-ui .inner i {
#pf2e-token-hud.dorako-ui.colorized .inner i {
text-shadow: 0px 0px 35px white, 0px 1px 1px black;
&.fa-solid.fa-circle-h {
color: darkgoldenrod;
Expand Down
41 changes: 21 additions & 20 deletions styles/module-support.css

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

Loading

0 comments on commit 500d8d4

Please sign in to comment.