mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 10:29:54 +02:00
Fixed so that hidden countdowns don't take up space
This commit is contained in:
parent
8e5cdedaac
commit
f91bfaecb1
3 changed files with 14 additions and 2 deletions
|
|
@ -186,6 +186,7 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
|||
|
||||
context.userCountdownTypes = game.user.getFlag(CONFIG.DH.id, CONFIG.DH.FLAGS.userFlags.countdownTypeModes)
|
||||
?? [shortterm.id, longterm.id];
|
||||
|
||||
context.typeToggles =
|
||||
Object.values(CONFIG.DH.GENERAL.countdownType).map(type => ({
|
||||
type: type.id,
|
||||
|
|
@ -194,6 +195,13 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
|
|||
}));
|
||||
|
||||
context.countdowns = this._getCountdownData();
|
||||
context.countdownTypesWithVisibleEntries = this.#getCountdowns().reduce((acc, data) => {
|
||||
if (context.userCountdownTypes.includes(data.countdown.type) && !acc.includes(data.countdown.type))
|
||||
acc.push(data.countdown.type);
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
|
||||
return context;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue