mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
add show countdown logic
This commit is contained in:
parent
411238ff40
commit
e3cda0a9c9
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue