mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Use CSS based solution for shifting the countdowns
This commit is contained in:
parent
f0d140544e
commit
b69f8940f5
3 changed files with 2 additions and 13 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
font-family: @font-body;
|
||||
}
|
||||
|
||||
&.effects-present {
|
||||
#ui-right:has(#effects-display .effect-container) & {
|
||||
right: 62px;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue