mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
Updated Armor SRD
This commit is contained in:
parent
47b16392eb
commit
b9e3eec34c
42 changed files with 1520 additions and 23 deletions
|
|
@ -7,3 +7,4 @@ export { default as DhFearTracker } from './fearTracker.mjs';
|
|||
export { default as DhHotbar } from './hotbar.mjs';
|
||||
export { default as DhSceneNavigation } from './sceneNavigation.mjs';
|
||||
export { ItemBrowser } from './itemBrowser.mjs';
|
||||
export { default as DhProgress } from './progress.mjs';
|
||||
|
|
|
|||
27
module/applications/ui/progress.mjs
Normal file
27
module/applications/ui/progress.mjs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
export default class DhProgress {
|
||||
#notification;
|
||||
|
||||
constructor({ max, label = '' }) {
|
||||
this.max = max;
|
||||
this.label = label;
|
||||
this.#notification = ui.notifications.info(this.label, { progress: true });
|
||||
}
|
||||
|
||||
updateMax(newMax) {
|
||||
this.max = newMax;
|
||||
}
|
||||
|
||||
advance({ by = 1, label = this.label } = {}) {
|
||||
if (this.value === this.max) return;
|
||||
this.value += Math.abs(by);
|
||||
this.#notification.update({ message: label, pct: this.value / this.max });
|
||||
}
|
||||
|
||||
close({ label = '' } = {}) {
|
||||
this.#notification.update({ message: label, pct: 1 });
|
||||
}
|
||||
|
||||
static createMigrationProgress(max = 0) {
|
||||
return new DhProgress({ max, label: game.i18n.localize('DAGGERHEART.UI.Progress.migrationLabel') });
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue