mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 13:11:08 +01:00
.
This commit is contained in:
parent
de9a66e1bc
commit
38868fdab6
23 changed files with 86 additions and 104 deletions
|
|
@ -59,9 +59,7 @@ export default class CountdownEdit extends HandlebarsApplicationMixin(Applicatio
|
|||
? 'DAGGERHEART.UI.Countdowns.decreasingLoop'
|
||||
: 'DAGGERHEART.UI.Countdowns.loop'
|
||||
: null;
|
||||
const randomizeValid = Roll.parse(countdown.progress.startFormula ?? '').some(
|
||||
x => x instanceof foundry.dice.terms.Die
|
||||
);
|
||||
const randomizeValid = !new Roll(countdown.progress.startFormula ?? '').isDeterministic;
|
||||
acc[key] = {
|
||||
...countdown,
|
||||
typeName: game.i18n.localize(CONFIG.DH.GENERAL.countdownBaseTypes[countdown.type].label),
|
||||
|
|
@ -208,17 +206,15 @@ export default class CountdownEdit extends HandlebarsApplicationMixin(Applicatio
|
|||
const countdown = this.data.countdowns[button.dataset.countdownId];
|
||||
const roll = await new Roll(countdown.progress.startFormula).roll();
|
||||
const message = await roll.toMessage({ title: 'Countdown' });
|
||||
const update = async () => {
|
||||
await this.updateSetting({
|
||||
[`countdowns.${button.dataset.countdownId}.progress`]: {
|
||||
start: roll.total,
|
||||
current: this.getMatchingCurrentValue(countdown, roll.total, countdown.progress.current)
|
||||
}
|
||||
});
|
||||
this.render();
|
||||
};
|
||||
|
||||
waitForDiceSoNice(message, update);
|
||||
await waitForDiceSoNice(message);
|
||||
await this.updateSetting({
|
||||
[`countdowns.${button.dataset.countdownId}.progress`]: {
|
||||
start: roll.total,
|
||||
current: this.getMatchingCurrentValue(countdown, roll.total, countdown.progress.current)
|
||||
}
|
||||
});
|
||||
this.render();
|
||||
}
|
||||
|
||||
static async #removeCountdown(event, button) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue