From 7d75c39f9bd3554e7c8cafcf727c8d3fa666c536 Mon Sep 17 00:00:00 2001 From: Dorako Date: Sat, 5 Feb 2022 02:25:40 +0100 Subject: [PATCH] Centered hotbar, v-padding decrease in cards, navbar color swap + tweaks, SmallTime patch --- CHANGELOG.md | 2 +- module.json | 2 +- scripts/dorako-ui.js | 41 ++++++++++++++++++++++++++ styles/app-ui.css | 3 +- styles/chat.css | 68 +++++++++++++++++++++++++++++++++++++++++--- styles/hotbar.css | 15 ---------- 6 files changed, 109 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 832125a..6bc0332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # 1.0.5 -Centered hotbar, v-padding decrease in cards, navbar color swap + tweaks, SmallTime patch +Centered hotbar setting, edge-margin setting, v-padding decrease in cards, navbar color swap + tweaks, SmallTime patch, Chat Portrait support, fix for 'flavor-text' # 1.0.4 Added support for Combat Enhancements module # 1.0.3 diff --git a/module.json b/module.json index dc5c046..32f0417 100644 --- a/module.json +++ b/module.json @@ -1,6 +1,6 @@ { "name": "pf2e-dorako-ui", - "title": "PF2e - Dorako UI", + "title": "PF2e Dorako UI", "description": "Overhauls the Foundry UI and several modules.", "url": "https://github.com/Dorako/pf2e-dorako-ui", "author": "Dorako", diff --git a/scripts/dorako-ui.js b/scripts/dorako-ui.js index b53b5f9..abb9c0b 100644 --- a/scripts/dorako-ui.js +++ b/scripts/dorako-ui.js @@ -112,6 +112,8 @@ Hooks.on('init', () => { // } // }); + + 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.", @@ -124,6 +126,36 @@ Hooks.on('init', () => { } }); + game.settings.register('pf2e-dorako-ui', 'center-hotbar', { + name: "Center hotbar (macrobar)?", + hint: "", + scope: "client", + type: Boolean, + default: false, + config: true, + onChange: () => { + location.reload(); + } + }); + + game.settings.register("pf2e-dorako-ui", "edge-offset", { + name: "Offset from the edge of screen in pixels", + hint: "", + scope: "client", + type: Number, + default: 10, + range: { + min: 5, + max: 30, + step: 1 + }, + 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.", @@ -298,6 +330,15 @@ Hooks.on('init', () => { if (!game.settings.get('pf2e-dorako-ui', 'disable-all-styles')) { injectBaseCss() + const root = document.querySelector(':root').style; + if (game.settings.get('pf2e-dorako-ui', 'center-hotbar')) { + root.setProperty("--hotbar-margin-left", 'calc(50% - 300px)'); + } else { + root.setProperty("--hotbar-margin-left", '10px'); + } + + root.setProperty("--edge-margin", game.settings.get('pf2e-dorako-ui', 'edge-offset').toString()+'px'); + if (game.settings.get('pf2e-dorako-ui', 'skin-navigation')) { skinNavigation() } diff --git a/styles/app-ui.css b/styles/app-ui.css index faf2727..d2792f7 100644 --- a/styles/app-ui.css +++ b/styles/app-ui.css @@ -41,9 +41,10 @@ margin: 0 var(--edge-margin) 0 var(--edge-margin); } +/* Hotbar */ #ui-bottom { /* margin-left: 9px; */ - margin-left: calc(50% - 300px); + margin-left: var(--hotbar-margin-left); } diff --git a/styles/chat.css b/styles/chat.css index 5a1f100..a55e38f 100644 --- a/styles/chat.css +++ b/styles/chat.css @@ -82,6 +82,7 @@ + #chat-form, #chat-controls, .dice-tray>*, @@ -112,7 +113,7 @@ "text text text text"minmax(min-content, max-content) /42px 1.5fr 0fr 2.8fr; background-color:var(--paizo-red); - border-bottom: 1px solid black; + /* border-bottom: 1px solid black; */ border-radius: 5px 5px 0px 0px; margin-top: -5px; padding-top: 5px; @@ -122,6 +123,60 @@ padding-left: 5px; } +.flavor-text { + background-size: cover; + background-image: var(--img-parchment); + background-blend-mode: luminosity; + /* background:#E5E1DA; */ + padding-left:5px; + margin-left:-5px; + padding-right:5px; + margin-right:-5px; +} + +.whisper .flavor-text { + background-color: #EDEDFF; + background-color: var(--whisper-bg); + +} + +.blind .flavor-text { + /* background: #FDE4FF; */ + background-color: var(--blind-bg); +} + + +.whisper-to { + background-size: cover; + background-image: var(--img-parchment); + background-blend-mode: luminosity; + background-color: var(--whisper-bg); + margin-right: -5px; + padding-right: 5px; + margin-left: -5px; + padding-left: 5px; +} + +.whisper-to * { + background-color: var(--whisper-bg); +} + +.message-content .dice-roll .dice-result .dice-total.statuseffect-message { + border: 0px; + margin-top: 5px; + box-shadow: none; + background: none; +} + +.message-content .dice-roll .statuseffect-message ul { + padding: 0px; +} + +#chat-log hr { + margin-top: 1px; + margin-bottom: 1px; +} + .message-content h3.chat-portrait-text-size-name { display: flex; align-items: center; @@ -146,10 +201,11 @@ border-width: 0px; } -.whisper-to * { - background-color: var(--whisper-bg); +.message-delete { + margin-left: 5px } + .chat-mode-indicator { background-color: rgba(140, 40, 40, 1); } @@ -179,6 +235,8 @@ border-image-width: 14px; border-style: double; padding: 5px; + padding-left: 8px; + padding-right: 8px; } .pf2e.chat-card .card-content p { @@ -289,6 +347,8 @@ + + #chat-log .message { margin: 0px; } @@ -387,7 +447,7 @@ button { #chat-log .message .message-header .flavor-text, #chat-log .message .message-header .whisper-to { grid-area: text; - padding: var(--body-padding); + /* padding: var(--body-padding); */ } .message.dfce-cm-top { diff --git a/styles/hotbar.css b/styles/hotbar.css index d15e67d..aeab94e 100644 --- a/styles/hotbar.css +++ b/styles/hotbar.css @@ -178,18 +178,3 @@ border-radius: 2px; overflow: hidden; } - - -#smalltime-app::after { - transition: box-shadow 0.5s ease-in-out; - content: ''; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - box-shadow: var(--glassy); - border-radius: 2px; - overflow: hidden; - z-index:1000; - } \ No newline at end of file