From e3cda0a9c973019516a2009fa9790d8ae99658fc Mon Sep 17 00:00:00 2001 From: Psitacus Date: Wed, 7 Jan 2026 20:05:04 -0700 Subject: [PATCH] add show countdown logic --- module/applications/ui/countdowns.mjs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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