diff --git a/module/applications/resources.mjs b/module/applications/resources.mjs index 9b9781e0..6956573e 100644 --- a/module/applications/resources.mjs +++ b/module/applications/resources.mjs @@ -22,7 +22,8 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2) frame: true, title: 'Fear', positioned: true, - resizable: true + resizable: true, + minimizable: false }, actions: { setFear: Resources.setFear, @@ -105,6 +106,5 @@ export default class Resources extends HandlebarsApplicationMixin(ApplicationV2) if (!game.user.isGM) return; value = Math.max(0, Math.min(this.maxFear, value)); await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear, value); - await this.render(true); } } diff --git a/module/applications/settings.mjs b/module/applications/settings.mjs index e39cab51..a1769c68 100644 --- a/module/applications/settings.mjs +++ b/module/applications/settings.mjs @@ -181,7 +181,10 @@ export const registerDHSettings = () => { scope: 'world', config: false, type: Number, - default: 0 + default: 0, + onChange: () => { + if (ui.resources) ui.resources.render({ force: true }); + } }); game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.MaxFear, { diff --git a/styles/daggerheart.css b/styles/daggerheart.css index 17d03a51..d84442b8 100755 --- a/styles/daggerheart.css +++ b/styles/daggerheart.css @@ -2934,11 +2934,18 @@ div.daggerheart.views.multiclass { --primary-color-fear: rgba(9, 71, 179, 0.75); --secondary-color-fear: rgba(9, 71, 179, 0.75); --shadow-text-stroke: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; + --fear-animation: background 0.3s ease, box-shadow .3s ease, border-color .3s ease, opacity .3s ease; } #resources { min-height: calc(var(--header-height) + 4rem); min-width: 4rem; color: #d3d3d3; + transition: var(--fear-animation); +} +#resources header, +#resources .controls, +#resources .window-resize-handle { + transition: var(--fear-animation); } #resources .window-content { padding: 0.5rem; @@ -3023,7 +3030,7 @@ div.daggerheart.views.multiclass { #resources .window-content #resource-fear.isGM i:hover { font-size: var(--font-size-20); } -#resources button[data-action='close'] { +#resources button[data-action="close"] { display: none; } #resources:not(:hover):not(.minimized) { @@ -3034,7 +3041,7 @@ div.daggerheart.views.multiclass { #resources:not(:hover):not(.minimized) header, #resources:not(:hover):not(.minimized) .controls, #resources:not(:hover):not(.minimized) .window-resize-handle { - visibility: hidden; + opacity: 0; } #resources:has(.fear-bar) { min-width: 200px; diff --git a/styles/resources.less b/styles/resources.less index 91a97e2d..3e2bc597 100644 --- a/styles/resources.less +++ b/styles/resources.less @@ -2,12 +2,19 @@ --primary-color-fear: rgba(9, 71, 179, 0.75); --secondary-color-fear: rgba(9, 71, 179, 0.75); --shadow-text-stroke: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000; + --fear-animation: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease; } #resources { min-height: calc(var(--header-height) + 4rem); min-width: 4rem; color: #d3d3d3; + transition: var(--fear-animation); + header, + .controls, + .window-resize-handle { + transition: var(--fear-animation); + } .window-content { padding: 0.5rem; #resource-fear { @@ -106,7 +113,7 @@ header, .controls, .window-resize-handle { - visibility: hidden; + opacity: 0; } } &:has(.fear-bar) {