Split into tabs

This commit is contained in:
WBHarry 2025-08-05 20:22:46 +02:00
parent 4827b337d0
commit d385bd1a90
7 changed files with 141 additions and 5 deletions

View file

@ -34,9 +34,18 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
};
static PARTS = {
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
settings: { template: 'systems/daggerheart/templates/settings/homebrew-settings/settings.hbs' },
domains: { template: 'systems/daggerheart/templates/settings/homebrew-settings/domains.hbs' },
downtime: { template: 'systems/daggerheart/templates/settings/homebrew-settings/downtime.hbs' }
};
/** @inheritdoc */
static TABS = {
main: {
template: 'systems/daggerheart/templates/settings/homebrew-settings.hbs',
scrollable: ['']
tabs: [{ id: 'settings' }, { id: 'domains' }, { id: 'downtime' }],
initial: 'settings',
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
}
};
@ -200,4 +209,13 @@ export default class DhHomebrewSettings extends HandlebarsApplicationMixin(Appli
}
return obj;
}
_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;
}
}