From b69f8940f5b1f9394dae48e14f38b607bcea37a0 Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Wed, 26 Nov 2025 04:18:18 -0500 Subject: [PATCH] Use CSS based solution for shifting the countdowns --- module/applications/ui/countdowns.mjs | 11 ----------- module/applications/ui/effectsDisplay.mjs | 2 +- styles/less/ui/countdown/countdown.less | 2 +- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/module/applications/ui/countdowns.mjs b/module/applications/ui/countdowns.mjs index 4fc6b7c7..96315b17 100644 --- a/module/applications/ui/countdowns.mjs +++ b/module/applications/ui/countdowns.mjs @@ -60,10 +60,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application async _renderFrame(options) { const frame = await super._renderFrame(options); - if (game.system.api.applications.ui.DhEffectsDisplay.getTokenEffects().length > 0) { - frame.classList.add('effects-present'); - } - const iconOnly = game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.countdownMode) === CONFIG.DH.GENERAL.countdownAppMode.iconOnly; @@ -154,11 +150,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application if (refreshType === RefreshType.Countdown) this.render(); }; - effectDisplayToggle = (hidden, _token) => { - if (hidden) this.element.classList.remove('effects-present'); - else this.element.classList.add('effects-present'); - }; - static canPerformEdit() { if (game.user.isGM) return true; @@ -243,7 +234,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application } setupHooks() { - Hooks.on(CONFIG.DH.HOOKS.effectDisplayToggle, this.effectDisplayToggle.bind()); Hooks.on(socketEvent.Refresh, this.cooldownRefresh.bind()); } @@ -251,7 +241,6 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application /* Opt out of Foundry's standard behavior of closing all application windows marked as UI when Escape is pressed */ if (options.closeKey) return; - Hooks.off(CONFIG.DH.HOOKS.effectDisplayToggle, this.effectDisplayToggle); Hooks.off(socketEvent.Refresh, this.cooldownRefresh); return super.close(options); } diff --git a/module/applications/ui/effectsDisplay.mjs b/module/applications/ui/effectsDisplay.mjs index 50eecabd..7f90e30b 100644 --- a/module/applications/ui/effectsDisplay.mjs +++ b/module/applications/ui/effectsDisplay.mjs @@ -81,7 +81,7 @@ export default class DhEffectsDisplay extends HandlebarsApplicationMixin(Applica Hooks.callAll(CONFIG.DH.HOOKS.effectDisplayToggle, this.element.hidden, token); - if (effects.length > 0) this.render(); + this.render(); } async removeEffect(event) { diff --git a/styles/less/ui/countdown/countdown.less b/styles/less/ui/countdown/countdown.less index 26dce469..47f06eb7 100644 --- a/styles/less/ui/countdown/countdown.less +++ b/styles/less/ui/countdown/countdown.less @@ -25,7 +25,7 @@ font-family: @font-body; } - &.effects-present { + #ui-right:has(#effects-display .effect-container) & { right: 62px; }