[Feature] Downtime Improvements (#411)

* Initial

* Fixed dialog again

* Fix healing targeted resource in setting

* Removed unused templates

---------

Co-authored-by: Dapoolp <elcatnet@gmail.com>
This commit is contained in:
WBHarry 2025-07-25 21:31:05 +02:00 committed by GitHub
parent 3f95740b7a
commit 62b9a8fbee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 538 additions and 457 deletions

View file

@ -36,10 +36,37 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
}
};
/** @inheritdoc */
static TABS = {
diceSoNice: {
tabs: [
{ id: 'hope', label: 'DAGGERHEART.GENERAL.hope' },
{ id: 'fear', label: 'DAGGERHEART.GENERAL.fear' },
{ id: 'advantage', label: 'DAGGERHEART.GENERAL.Advantage.full' },
{ id: 'disadvantage', label: 'DAGGERHEART.GENERAL.Advantage.full' }
],
initial: 'hope'
}
};
changeTab(tab, group, options) {
super.changeTab(tab, group, options);
this.render();
}
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.settingFields = this.settings;
context.diceSoNiceTextures = game.dice3d?.exports?.TEXTURELIST ?? {};
context.diceSoNiceColorsets = game.dice3d?.exports?.COLORSETS ?? {};
context.diceTab = {
key: this.tabGroups.diceSoNice,
source: this.settings._source.diceSoNice[this.tabGroups.diceSoNice],
fields: this.settings.schema.fields.diceSoNice.fields[this.tabGroups.diceSoNice].fields
};
return context;
}
@ -65,4 +92,13 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
this.close();
}
_getTabs(tabs) {
for (const v of Object.values(tabs)) {
v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active;
v.cssClass = v.active ? 'active' : '';
}
return tabs;
}
}