add show countdown logic

This commit is contained in:
Psitacus 2026-01-07 20:05:04 -07:00
parent 411238ff40
commit e3cda0a9c9

View file

@ -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