mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +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);
|
super(options);
|
||||||
|
|
||||||
this.setupHooks();
|
this.setupHooks();
|
||||||
|
this._isFocused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
|
|
@ -139,6 +140,16 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
||||||
return context;
|
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) {
|
static #getPlayerOwnership(user, setting, countdown) {
|
||||||
const playerOwnership = countdown.ownership[user.id];
|
const playerOwnership = countdown.ownership[user.id];
|
||||||
return playerOwnership === undefined || playerOwnership === CONST.DOCUMENT_OWNERSHIP_LEVELS.INHERIT
|
return playerOwnership === undefined || playerOwnership === CONST.DOCUMENT_OWNERSHIP_LEVELS.INHERIT
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue