Skip to content

Commit

Permalink
1.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Jan 15, 2023
1 parent ceafef6 commit cf5ab4c
Show file tree
Hide file tree
Showing 15 changed files with 124 additions and 70 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.10.1

- (Fix) Fix selects on Windows being illegible on dark theme or Polyglot
- (Fix) Fix default values for some settings referring to non-existing keys
- (New) Made several settings apply on saving, thereby not requiring a refresh

# 1.10.0.1

- (Fix) Fix theme setting for NPC sheets not working
Expand Down
6 changes: 3 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"flags": {}
}
],
"version": "1.10.0.1",
"version": "1.10.1",
"compatibility": {
"minimum": "10",
"verified": "10"
Expand All @@ -24,7 +24,7 @@
"type": "system",
"compatibility": {
"minimum": "4.0.0",
"verified": "4.6.5"
"verified": "4.6.6"
}
}
]
Expand Down Expand Up @@ -63,6 +63,6 @@
"modules/settings/settings.js",
"modules/dark-theme-hooks.js"
],
"download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.10.0.1.zip",
"download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.10.1.zip",
"manifest": "https://github.com/Dorako/pf2e-dorako-ui/releases/latest/download/module.json"
}
6 changes: 5 additions & 1 deletion modules/settings/avatar-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export class AvatarSettings extends SettingsMenuDorakoUI {
step: 1,
},
config: true,
requiresReload: true
requiresReload: false,
onChange: () => {
const root = document.querySelector(":root").style;
root.setProperty("--avatar-size", game.settings.get("pf2e-dorako-ui", "avatar.size").toString() + "px");
}
},
"small-creature-token-avatar-size": {
name: "pf2e-dorako-ui.settings.avatar.small-creature-token-avatar-size.name",
Expand Down
104 changes: 56 additions & 48 deletions modules/settings/settings.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
import * as util from '../util.js'
import { ThemeSettings } from "./theme-settings.js";
import { UXSettings } from "./ux-settings.js";
import { AvatarSettings } from "./avatar-settings.js";
import { MiscSettings } from "./misc-settings.js";
import {
ThemeSettings
} from "./theme-settings.js";
import {
UXSettings
} from "./ux-settings.js";
import {
AvatarSettings
} from "./avatar-settings.js";
import {
MiscSettings
} from "./misc-settings.js";

function injectCSS(filename) {
const head = document.getElementsByTagName("head")[0];
const mainCss = document.createElement("link");
mainCss.setAttribute("rel", "stylesheet");
mainCss.setAttribute("type", "text/css");
mainCss.setAttribute("href", "modules/pf2e-dorako-ui/styles/" + filename + ".css");
mainCss.setAttribute("media", "all");
head.insertBefore(mainCss, head.lastChild);
const head = document.getElementsByTagName("head")[0];
const mainCss = document.createElement("link");
mainCss.setAttribute("rel", "stylesheet");
mainCss.setAttribute("type", "text/css");
mainCss.setAttribute("href", "modules/pf2e-dorako-ui/styles/" + filename + ".css");
mainCss.setAttribute("media", "all");
head.insertBefore(mainCss, head.lastChild);
}

Hooks.once("init", async () => {
Expand Down Expand Up @@ -40,7 +48,7 @@ Hooks.once("init", async () => {
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",
icon: "fas fa-sliders",
type: UXSettings,
restricted: false
});
Expand All @@ -56,41 +64,41 @@ Hooks.once("init", async () => {
});
MiscSettings.registerSettings();

injectCSS("dorako-ui");
injectCSS("reset");
injectCSS("main");
injectCSS("dark-theme");
injectCSS("dark-theme-messages");
injectCSS("module-support");
injectCSS("messages");
injectCSS("npc-sheet");
injectCSS("loot-sheet");
injectCSS("chat-bubbles");
const root = document.querySelector(":root").style;
if (game.settings.get("pf2e-dorako-ui", "ux.center-hotbar")) {
document.getElementById("ui-bottom").classList.add("centered");
}
root.setProperty("--avatar-size", game.settings.get("pf2e-dorako-ui", "avatar.size").toString() + "px");
root.setProperty("--chat-input-height", game.settings.get("pf2e-dorako-ui", "ux.chat-input-height").toString() + "px");
if (game.settings.get("pf2e-dorako-ui", "misc.skin-crb-journal")) {
injectCSS("crb-journal");
injectCSS("fonts");
}
if (game.settings.get("pf2e-dorako-ui", "misc.skin-combat-carousel")) injectCSS("combat-carousel");
if (game.settings.get("pf2e-dorako-ui", "ux.compact-ui")) injectCSS("compact-ui");
if (game.settings.get("pf2e-dorako-ui", "ux.no-logo")) injectCSS("no-logo");
if (game.settings.get("pf2e-dorako-ui", "ux.no-chat-control-icon")) injectCSS("no-chat-control-icon");
const pcSheetSetting = game.settings.get("pf2e-dorako-ui", "theme.pc-sheet-theme");
if (pcSheetSetting == "dark-theme") injectCSS("pc-sheet-dark");
const familiarSheetSetting = game.settings.get("pf2e-dorako-ui", "theme.familiar-sheet-theme");
if (familiarSheetSetting == "dark" || familiarSheetSetting == "darkRedHeader") injectCSS("familiar-sheet-dark");
if (familiarSheetSetting == "darkRedHeader") injectCSS("familiar-sheet-dark-red-header");
});

injectCSS("dorako-ui");
injectCSS("reset");
injectCSS("main");
injectCSS("dark-theme");
injectCSS("dark-theme-messages");
injectCSS("module-support");
injectCSS("messages");
injectCSS("npc-sheet");
injectCSS("loot-sheet");
injectCSS("chat-bubbles");

const root = document.querySelector(":root").style;
if (game.settings.get("pf2e-dorako-ui", "ux.center-hotbar")) {
document.getElementById("ui-bottom").classList.add("centered");
}

root.setProperty("--avatar-size", game.settings.get("pf2e-dorako-ui", "avatar.size").toString() + "px");
root.setProperty("--chat-input-height", game.settings.get("pf2e-dorako-ui", "ux.chat-input-height").toString() + "px");

if (game.settings.get("pf2e-dorako-ui", "misc.skin-crb-journal")) {
injectCSS("crb-journal");
injectCSS("fonts");
}

if (game.settings.get("pf2e-dorako-ui", "misc.skin-combat-carousel")) injectCSS("combat-carousel");
if (game.settings.get("pf2e-dorako-ui", "ux.compact-ui")) injectCSS("compact-ui");
if (game.settings.get("pf2e-dorako-ui", "ux.no-logo")) injectCSS("no-logo");
if (game.settings.get("pf2e-dorako-ui", "ux.no-chat-control-icon")) injectCSS("no-chat-control-icon");
const pcSheetSetting = game.settings.get("pf2e-dorako-ui", "theme.pc-sheet-theme");
if (pcSheetSetting == "dark-theme") injectCSS("pc-sheet-dark");
const familiarSheetSetting = game.settings.get("pf2e-dorako-ui", "theme.familiar-sheet-theme");
if (familiarSheetSetting == "dark" || familiarSheetSetting == "darkRedHeader") injectCSS("familiar-sheet-dark");
if (familiarSheetSetting == "darkRedHeader") injectCSS("familiar-sheet-dark-red-header");
});

Hooks.once("ready", () => {
const frostedGlass = game.settings.get("pf2e-dorako-ui", "theme.frosted-glass");
Expand All @@ -104,7 +112,7 @@ Hooks.once("ready", () => {
const glassBg = game.settings.get("pf2e-dorako-ui", "theme.glass-bg");
if (!glassBg) return;
const root = document.querySelector(":root").style;
root.setProperty("--glass-bg", glassBg,"important");
root.setProperty("--glass-bg", glassBg, "important");
});

Hooks.once("renderSidebar", () => {
Expand Down
18 changes: 13 additions & 5 deletions modules/settings/theme-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class ThemeSettings extends SettingsMenuDorakoUI {
hint: "pf2e-dorako-ui.settings.theme.chat-theme.hint",
scope: "client",
config: true,
default: "Light",
default: "light",
type: String,
choices: {
light: "pf2e-dorako-ui.text.light",
Expand Down Expand Up @@ -55,7 +55,11 @@ export class ThemeSettings extends SettingsMenuDorakoUI {
config: true,
default: "",
type: String,
requiresReload: true
requiresReload: false,
onChange: () => {
const root = document.querySelector(":root").style;
root.setProperty("--frosted-glass", game.settings.get("pf2e-dorako-ui", "theme.frosted-glass"));
}
},
"glass-bg": {
name: "pf2e-dorako-ui.settings.theme.glass-bg.name",
Expand All @@ -64,14 +68,18 @@ export class ThemeSettings extends SettingsMenuDorakoUI {
config: true,
default: "",
type: String,
requiresReload: true
requiresReload: false,
onChange: () => {
const root = document.querySelector(":root").style;
root.setProperty("--glass-bg", game.settings.get("pf2e-dorako-ui", "theme.glass-bg"));
}
},
"dark-theme-degree": {
name: "pf2e-dorako-ui.settings.theme.dark-theme-degree.name",
hint: "pf2e-dorako-ui.settings.theme.dark-theme-degree.hint",
scope: "client",
config: true,
default: "default",
default: "none",
type: String,
choices: {
"none": "pf2e-dorako-ui.settings.theme.dark-theme-degree.choice.none",
Expand All @@ -86,7 +94,7 @@ export class ThemeSettings extends SettingsMenuDorakoUI {
hint: "pf2e-dorako-ui.settings.theme.pc-sheet-theme.hint",
scope: "client",
config: true,
default: "light-theme",
default: "default",
type: String,
choices: {
"default": "pf2e-dorako-ui.text.default",
Expand Down
6 changes: 5 additions & 1 deletion modules/settings/ux-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export class UXSettings extends SettingsMenuDorakoUI {
step: 5,
},
config: true,
requiresReload: true
requiresReload: false,
onChange: () => {
const root = document.querySelector(":root").style;
root.setProperty("--chat-input-height", game.settings.get("pf2e-dorako-ui", "ux.chat-input-height").toString() + "px");
}
},
"restructure-card-info": {
name: "pf2e-dorako-ui.settings.ux.restructure-card-info.name",
Expand Down
1 change: 1 addition & 0 deletions sass/_token-hud.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "mixins";

#token-hud {
--secondary-dark: var(--glass-bg);
.status-effects {
background: none;
box-shadow: none;
Expand Down
5 changes: 5 additions & 0 deletions sass/dark-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@
select {
@include glass;
color: var(--color-text-light-heading);

option {
background-color: rgb(37, 37, 37);
color: var(--color-text-light-highlight);
}
}

input[type="color"][data-edit] {
Expand Down
13 changes: 11 additions & 2 deletions sass/module-support.scss
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ div#scrollToBottom {
text-shadow: 0px 0px 3px black;

option {
@include glass;
backdrop-filter: blur(5px);
background-color: rgb(37, 37, 37);
color: var(--color-text-light-highlight);
}
}
}
Expand Down Expand Up @@ -450,6 +450,15 @@ nav.damage-log-nav.tabs {
}
}


/* ----------------------------------------- */
/* Monk's Player Settings */
/* ----------------------------------------- */

#client-settings.dark-theme #mps-view-group {
border-bottom: 1px solid var(--tertiary);
}

/* ----------------------------------------- */
/* Monk's tokenbar */
/* ----------------------------------------- */
Expand Down
4 changes: 4 additions & 0 deletions styles/dark-theme.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/dark-theme.css.map

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

3 changes: 3 additions & 0 deletions styles/main.css

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

Loading

0 comments on commit cf5ab4c

Please sign in to comment.