- Remove custom tab implementation in favor of official ApplicationV2 tabs - Implement ApplicationTab typedef structure for Actor and Item sheets - Add memory-safe event listener management with proper cleanup - Update all sheet templates to use standard Foundry tab structure - Add template safety checks to prevent undefined access errors - Optimize performance with DOM updates instead of full re-renders - Maintain backward CSS compatibility during transition - Add dynamic tab configuration based on item types Key improvements: - ~200 lines of custom tab code removed - Memory leak prevention with proper event cleanup - Performance optimization (no re-render on tab switch) - Standards-compliant with Foundry V13 ApplicationV2 API - Consistent implementation across Actor and Item sheets - Template safety with Handlebars guards - Dynamic icon and localization support All 31 modified files now use the official Foundry VTT v13 tab system.
59 lines
2.4 KiB
Handlebars
59 lines
2.4 KiB
Handlebars
{{!--
|
|
SPDX-FileCopyrightText: 2021 Johannes Loher
|
|
SPDX-FileCopyrightText: 2021 Oliver Rümpelein
|
|
SPDX-FileCopyrightText: 2021 Gesina Schwalbe
|
|
|
|
SPDX-License-Identifier: MIT
|
|
--}}
|
|
|
|
<form class="{{cssClass}} ds4-sheet-form" autocomplete="off">
|
|
{{!-- Header --}}
|
|
{{#> systems/ds4/templates/sheets/actor/components/actor-header.hbs}}
|
|
{{> systems/ds4/templates/sheets/actor/components/character-properties.hbs}}
|
|
{{/systems/ds4/templates/sheets/actor/components/actor-header.hbs}}
|
|
|
|
{{!-- Sheet Tab Navigation --}}
|
|
<nav class="tabs" data-group="primary">
|
|
{{#each tabs}}
|
|
<a class="item {{cssClass}}" data-tab="{{id}}" data-group="{{group}}">
|
|
{{#if icon}}<i class="{{icon}}"></i>{{/if}}
|
|
{{label}}
|
|
</a>
|
|
{{/each}}
|
|
</nav>
|
|
|
|
{{!-- Sheet Body --}}
|
|
<section class="sheet-body">
|
|
{{!-- Values Tab --}}
|
|
<div class="tab {{#if tabs.values}}{{tabs.values.cssClass}}{{/if}}" data-tab="values" data-group="primary">
|
|
{{> systems/ds4/templates/sheets/actor/components/core-values.hbs}}
|
|
{{> systems/ds4/templates/sheets/actor/components/combat-values.hbs}}
|
|
{{> systems/ds4/templates/sheets/actor/components/checks.hbs}}
|
|
</div>
|
|
|
|
{{!-- Inventory Tab --}}
|
|
<div class="tab {{#if tabs.inventory}}{{tabs.inventory.cssClass}}{{/if}}" data-tab="inventory" data-group="primary">
|
|
{{> systems/ds4/templates/sheets/actor/tabs/character-inventory.hbs}}
|
|
</div>
|
|
|
|
{{!-- Spells Tab --}}
|
|
<div class="tab {{#if tabs.spells}}{{tabs.spells.cssClass}}{{/if}}" data-tab="spells" data-group="primary">
|
|
{{> systems/ds4/templates/sheets/actor/tabs/spells.hbs}}
|
|
</div>
|
|
|
|
{{!-- Abilities Tab --}}
|
|
<div class="tab {{#if tabs.abilities}}{{tabs.abilities.cssClass}}{{/if}}" data-tab="abilities" data-group="primary">
|
|
{{> systems/ds4/templates/sheets/actor/tabs/character-abilities.hbs}}
|
|
</div>
|
|
|
|
{{!-- Effects Tab --}}
|
|
<div class="tab {{#if tabs.effects}}{{tabs.effects.cssClass}}{{/if}}" data-tab="effects" data-group="primary">
|
|
{{> systems/ds4/templates/sheets/actor/tabs/effects.hbs}}
|
|
</div>
|
|
|
|
{{!-- Biography Tab --}}
|
|
<div class="tab {{#if tabs.biography}}{{tabs.biography.cssClass}}{{/if}}" data-tab="biography" data-group="primary">
|
|
{{> systems/ds4/templates/sheets/actor/tabs/biography.hbs}}
|
|
</div>
|
|
</section>
|
|
</form>
|