Skip to content

Commit

Permalink
Initial Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorako committed Feb 3, 2022
1 parent 8231617 commit ee6f4cb
Show file tree
Hide file tree
Showing 14 changed files with 1,203 additions and 539 deletions.
3 changes: 2 additions & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"scripts": [
"scripts/dorako-ui.js"
],
"dependencies": [ { "name": "lib-df-hotkeys" }, { "name": "colorsettings" } ]
"dependencies": [ { "name": "lib-df-hotkeys" }, { "name": "colorsettings" } ],
"download": "https://github.com/Dorako/pf2e-dorako-ui/archive/refs/tags/v1.0.0.zip"
}
242 changes: 227 additions & 15 deletions scripts/dorako-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,21 @@ Hooks.on('init', () => {
// }
// });

game.settings.register('pf2e-dorako-ui', 'skin-modules', {
name: "Skin popular modules?",
hint: "Applies consistent theming to various modules (Disabling can have unintended consequenses)",
game.settings.register('pf2e-dorako-ui', 'disable-all-styles', {
name: "Disable all styles?",
hint: "Ignore all the toggles and removes any effect of the module, without having to disable it.",
scope: "client",
type: Boolean,
default: false,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-chat', {
name: "Apply skin to chat?",
hint: "Applies theming to chat cards and sidebar content.",
scope: "world",
type: Boolean,
default: true,
Expand All @@ -124,19 +136,141 @@ Hooks.on('init', () => {
}
});

game.settings.register('pf2e-dorako-ui', 'skin-navigation', {
name: "Apply skin to scene navigation?",
hint: "",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'disable-all-styles', {
name: "Disable all styles?",
hint: "Ignore all the toggles and removes any effect of the module, without having to disable it.",
scope: "client",
game.settings.register('pf2e-dorako-ui', 'skin-hotbar', {
name: "Apply skin to the hotbar (macro bar)?",
hint: "",
scope: "world",
type: Boolean,
default: false,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-controls', {
name: "Apply skin to scene controls?",
hint: "",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-token-hud', {
name: "Apply skin to the token HUD?",
hint: "",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-effect-panel', {
name: "Apply skin to the effect panel?",
hint: "",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-sidebar', {
name: "Apply skin to the sidebar?",
hint: "",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-app-ui', {
name: "Apply skin to app UI?",
hint: "This includes the player box, window headers, and similar",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-combat-tracker', {
name: "Apply skin to the combat tracker?",
hint: "",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-custom-hotbar', {
name: "Apply skin to Custom Hotbar module?",
hint: "",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-token-action-hud', {
name: "Apply skin to Token Action HUD?",
hint: "Makes TAH more compact and fits in better with the rest of the UI.",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});

game.settings.register('pf2e-dorako-ui', 'skin-window-controls', {
name: "Apply skin to Window Controls module?",
hint: "",
scope: "world",
type: Boolean,
default: true,
config: true,
onChange: () => {
location.reload();
}
});




// game.settings.register('dorako-ui', 'highlightGmOwnerText', {
// name: game.i18n.localize('RPGUI.SETTINGS.HIGHLIGHT_GM_OWNER_TEXT'),
// hint: game.i18n.localize('RPGUI.SETTINGS.HIGHLIGHT_GM_OWNER_TEXT_HINT'),
Expand All @@ -163,16 +297,44 @@ Hooks.on('init', () => {

if (!game.settings.get('pf2e-dorako-ui', 'disable-all-styles')) {
injectBaseCss()
skinChat()
skinNavigation()
skinControls()
skinTokenHud()

if (game.settings.get('pf2e-dorako-ui', 'skin-modules')) {
skinCustomHotbar()
skinTokenActionHud()
if (game.settings.get('pf2e-dorako-ui', 'skin-navigation')) {
skinNavigation()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-controls')) {
skinControls()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-token-hud')) {
skinTokenHud()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-chat')) {
skinChat()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-sidebar')) {
skinSidebar()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-combat-tracker')) {
skinCombatTracker()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-effect-panel')) {
skinEffectPanel()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-app-ui')) {
skinAppUi()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-hotbar')) {
skinHotbar()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-window-controls')) {
skinWindowControls()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-token-action-hud')) {
skinTokenActionHud()
}
if (game.settings.get('pf2e-dorako-ui', 'skin-custom-hotbar')) {
skinCustomHotbar()
}

}

});
Expand Down Expand Up @@ -235,6 +397,16 @@ function skinChat() {
head.insertBefore(newCss, head.lastChild);
}

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

function skinControls() {
const head = document.getElementsByTagName("head")[0];
const newCss = document.createElement("link");
Expand All @@ -255,6 +427,16 @@ function skinNavigation() {
head.insertBefore(newCss, head.lastChild);
}

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

function skinTokenHud() {
const head = document.getElementsByTagName("head")[0];
const newCss = document.createElement("link");
Expand All @@ -265,6 +447,36 @@ function skinTokenHud() {
head.insertBefore(newCss, head.lastChild);
}

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

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

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


// Modules

Expand Down
92 changes: 92 additions & 0 deletions styles/app-ui.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* App UI */

/* Glass - Remove prior styling */

#players,
.app,
.window-app .window-header,
.window-app.minimized .window-header
{
border: none;
border-radius: 0px;
box-shadow: none;
backdrop-filter: none;
background: none;
background-image: none;
}

/* Glass - Add new styling */

#players,
.window-app .window-header,
.window-app.minimized .window-header
{
border: none;
border-radius: var(--dorako-radius);
background-color: var(--dorako-bg-current);
backdrop-filter: var(--dorako-vibrancy);
/*will-change: backdrop-filter;*/
transform: translate3d(0px, 0px, 0px);
box-shadow: var(--glassy);
}

.window-app .window-header {
border-radius: var(--dorako-radius) var(--dorako-radius) 0px 0px;
box-shadow: var(--glassy);
}

.window-app .window-content {
/* box-shadow: 0px 0px 10px black; */
box-shadow: var(--glassy);
background: none;
background-color: var(--bg);
background-image: var(--pf2e-sheets-bg);
background-size: cover;
}

#players,
.window-app .window-header a,
.window-app .window-header .window-title {
text-shadow: var(--dorako-text-shadow);
}

.editable .crb-style {
text-rendering: geometricPrecision;
}

#compendium-browser>section.window-content>.content-box>nav, #license-viewer>section.window-content>.content-box>nav {
box-shadow: none;
}

#compendium-browser>section.window-content>.content-box>section.content, #license-viewer>section.window-content>.content-box>section.content {
height: 100%;
margin-top: 5px;
}

.window-app .window-content {
padding: 5px 5px 0px 5px;
}

.window-app .window-header {
margin-bottom: 0px;
}

.app {
color: var(--color-text-light-1);
}

.window-app .window-resizable-handle {
position: absolute;
bottom: -5px;
right: -5px;
background: none;
padding: 2px;
border: none;
text-shadow: var(--dorako-text-shadow);
}

.app.sidebar-popout {
border: none;
border-radius: var(--dorako-radius);
background-color: var(--dorako-bg-current);
}
Loading

0 comments on commit ee6f4cb

Please sign in to comment.