restores hiding of unimportant sheets

feature/applicationv2
macniel 2025-10-17 18:24:58 +02:00
parent 34a5028e30
commit 69ceb48871
3 changed files with 25 additions and 20 deletions

View File

@ -104,8 +104,11 @@ export default {
_onRender: (context, options) => { _onRender: (context, options) => {
}, },
_getTabConfig: (group) => { _getTabConfig: (group, thisObject) => {
group.tabs.push({id: "liturgies", group: "sheet", label: "Liturgien"}) const hasLiturgies = thisObject.document.items.filter(p => p.type === "Liturgy").length > 0 ?? false
if (hasLiturgies) {
group.tabs.push({id: "liturgies", group: "sheet", label: "Liturgien"})
}
}, },
template: `systems/DSA_4-1/templates/actor/character/tab-liturgies.hbs` template: `systems/DSA_4-1/templates/actor/character/tab-liturgies.hbs`
} }

View File

@ -45,8 +45,11 @@ export default {
_onRender: (context, options) => { _onRender: (context, options) => {
}, },
_getTabConfig: (group) => { _getTabConfig: (group, thisObject) => {
group.tabs.push({id: "spells", group: "sheet", label: "Zauber"}) const hasSpells = thisObject.document.items.filter(p => p.type === "Spell").length > 0 ?? false
if (hasSpells) {
group.tabs.push({id: "spells", group: "sheet", label: "Zauber"})
}
}, },
template: `systems/DSA_4-1/templates/actor/character/tab-spells.hbs` template: `systems/DSA_4-1/templates/actor/character/tab-spells.hbs`
} }

View File

@ -38,13 +38,12 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
sheet: { sheet: {
tabs: [ tabs: [
{id: 'meta', group: 'sheet', label: 'Meta'}, {id: 'meta', group: 'sheet', label: 'Meta'},
{id: 'attributes', group: 'sheet', label: 'Eigenschaften'}, // {id: 'attributes', group: 'sheet', label: 'Eigenschaften'},
{id: 'combat', group: 'sheet', label: 'Kampf'}, // {id: 'combat', group: 'sheet', label: 'Kampf'},
{id: 'equipment', group: 'sheet', label: 'Inventar'}, // {id: 'equipment', group: 'sheet', label: 'Inventar'},
{id: 'skills', group: 'sheet', label: 'Talente'}, // {id: 'skills', group: 'sheet', label: 'Talente'},
{id: 'spells', group: 'sheet', label: 'Zauber'}, // {id: 'spells', group: 'sheet', label: 'Zauber'},
{id: 'liturgies', group: 'sheet', label: 'Liturgien'}, // {id: 'liturgies', group: 'sheet', label: 'Liturgien'},
], ],
initial: 'meta' initial: 'meta'
} }
@ -110,19 +109,19 @@ class CharacterSheet extends HandlebarsApplicationMixin(ActorSheetV2) {
await this.document.update(formData.object) // Note: formData.object await this.document.update(formData.object) // Note: formData.object
} }
/*
_getTabsConfig(group) { _getTabsConfig(group) {
const tabs = foundry.utils.deepClone(super._getTabsConfig(group)) const tabs = foundry.utils.deepClone(super._getTabsConfig(group))
Attributes._getTabConfig(tabs) Attributes._getTabConfig(tabs, this)
Combat._getTabConfig(tabs) Combat._getTabConfig(tabs, this)
Equipment._getTabConfig(tabs) Equipment._getTabConfig(tabs, this)
Skills._getTabConfig(tabs) Skills._getTabConfig(tabs, this)
Spells._getTabConfig(tabs) Spells._getTabConfig(tabs, this)
Liturgies._getTabConfig(tabs) Liturgies._getTabConfig(tabs, this)
Effects._getTabConfig(tabs) Effects._getTabConfig(tabs, this)
return tabs return tabs
} }
*/
async _preparePartContext(partId, context) { async _preparePartContext(partId, context) {
switch (partId) { switch (partId) {
case "form": case "form":