mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
[Feature] CountdownsType Split (#1990)
* Toggle pills * Finished animation framework * . * Fixed localization * Fixed iconOnly * Updated SRD Action Countdown types * feat: add shimmer animation when change countdown value * Fixed so that hidden countdowns don't take up space * Fixed countdowns.hbs part using wrong context for iconOnly * Restored glow animation for category chip * Changed back to a single sheen effect * [Review] Move visible countdown types to getter (#1999) * Move visible countdown types to getter * Punchier shimmer animation * Restored encounter/narrative * Lang cleanup * . --------- Co-authored-by: Murilo Brito <dev.murilobrito@gmail.com> Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
parent
3a3aa17a1c
commit
d2e87e4eb9
14 changed files with 267 additions and 77 deletions
|
|
@ -13,6 +13,20 @@ export default class DhCountdowns extends foundry.abstract.DataModel {
|
|||
})
|
||||
};
|
||||
}
|
||||
|
||||
handleChange() {
|
||||
const previousCountdowns = foundry.ui.countdowns.previousCountdownData;
|
||||
const changedCountdowns = Object.entries(this.countdowns).reduce((acc, [key, countdown]) => {
|
||||
const previousCountdown = previousCountdowns[key];
|
||||
if (!previousCountdown || (previousCountdown.progress.current !== countdown.progress.current)) {
|
||||
acc.push(key);
|
||||
}
|
||||
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
foundry.ui.countdowns.changedCountdownsForAnimation.add(...changedCountdowns);
|
||||
}
|
||||
}
|
||||
|
||||
export class DhCountdown extends foundry.abstract.DataModel {
|
||||
|
|
@ -21,7 +35,8 @@ export class DhCountdown extends foundry.abstract.DataModel {
|
|||
return {
|
||||
type: new fields.StringField({
|
||||
required: true,
|
||||
choices: CONFIG.DH.GENERAL.countdownBaseTypes,
|
||||
choices: CONFIG.DH.GENERAL.countdownTypes,
|
||||
initial: CONFIG.DH.GENERAL.countdownTypes.encounter.id,
|
||||
label: 'DAGGERHEART.GENERAL.type'
|
||||
}),
|
||||
name: new fields.StringField({
|
||||
|
|
@ -85,7 +100,7 @@ export class DhCountdown extends foundry.abstract.DataModel {
|
|||
: undefined;
|
||||
|
||||
return {
|
||||
type: type ?? CONFIG.DH.GENERAL.countdownBaseTypes.narrative.id,
|
||||
type: type ?? CONFIG.DH.GENERAL.countdownTypes.encounter.id,
|
||||
name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Countdown.newCountdown'),
|
||||
img: 'icons/magic/time/hourglass-yellow-green.webp',
|
||||
ownership: ownership,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue