This commit is contained in:
WBHarry 2025-11-25 00:21:32 +01:00
parent de9a66e1bc
commit 38868fdab6
23 changed files with 86 additions and 104 deletions

View file

@ -200,20 +200,16 @@ export default class DhCountdowns extends HandlebarsApplicationMixin(Application
? Math.max(Number(progressMax) - 1, 0)
: progressMax;
const update = async () => {
await settings.updateSource({
[`countdowns.${target.id}.progress`]: {
current: newMax,
start: newMax
}
});
await emitAsGM(GMUpdateEvent.UpdateCountdowns, DhCountdowns.gmSetSetting.bind(settings), settings, null, {
refreshType: RefreshType.Countdown
});
};
if (message) waitForDiceSoNice(message, update);
else update();
await waitForDiceSoNice(message);
await settings.updateSource({
[`countdowns.${target.id}.progress`]: {
current: newMax,
start: newMax
}
});
await emitAsGM(GMUpdateEvent.UpdateCountdowns, DhCountdowns.gmSetSetting.bind(settings), settings, null, {
refreshType: RefreshType.Countdown
});
}
static async editCountdown(increase, target) {