diff --git a/module/applications/ui/countdowns.mjs b/module/applications/ui/countdowns.mjs index 42920a4a..1ebec9b6 100644 --- a/module/applications/ui/countdowns.mjs +++ b/module/applications/ui/countdowns.mjs @@ -15,6 +15,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application super(options); this.setupHooks(); + this._isFocused = false; } /** @inheritDoc */ @@ -139,6 +140,16 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application return context; } + /**Filter countdowns based on focus state */ + #shouldShowCountdown(countdown){ + // Always show narrative and encounter countdowns + if (countdown.type !== CONFIG.DH.GENERAL.countdownBaseTypes.longterm.id){ + return true; + } + // Only show longterm countdowns when focused/hovered + return this._isFocused; + } + static #getPlayerOwnership(user, setting, countdown) { const playerOwnership = countdown.ownership[user.id]; return playerOwnership === undefined || playerOwnership === CONST.DOCUMENT_OWNERSHIP_LEVELS.INHERIT