- 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.
- Fix item sheet effects template to use enrichedEffects instead of data.effects
- Ensures effects are properly displayed in the item sheet effects tab
- Aligns with actor sheet implementation for consistency
The template was referencing data.effects but the context preparation creates
enrichedEffects array with additional metadata (id, uuid, sourceName).
- Remove duplicate action handlers (edititem, deleteitem, createitem, etc.) from DS4ActorSheet and DS4ItemSheet
- Fix editImage method reference from static to prototype in DS4ActorSheet
- Add capitalize helper to handlebars-helpers.ts for dynamic action name generation
- Update control-button-group.hbs and add-button.hbs templates to use concat and capitalize helpers
- Ensure consistent camelCase naming for all action handlers (editItem, deleteItem, createItem, etc.)
This resolves action handler conflicts and improves maintainability by using dynamic template generation
instead of hardcoded conditional logic.
Convert DS4ItemSheet and all item sheet templates from ApplicationV1 to
ItemSheetV2. Add V2 action handlers, tab navigation, and form
processing. Update effect management to use DialogV2. Preserve all
functionality including tab state and override handling.
Convert DS4ActorSheet, DS4CharacterActorSheet, and DS4CreatureActorSheet
from ApplicationV1 to ApplicationV2 architecture. Update all templates
to use data-action attributes. Implement manual tab system and preserve
all existing functionality including item management, effects, and
rolling system.
BREAKING CHANGE: Requires FoundryVTT ApplicationV2 system
This also allows to assign a spell to multiple spell groups, which is the case for many spells in
the SRD.
Additionally, this makes many small improvements and fixes to the provided spell compendium.
In the Active Effect Config, there are now additional inputs to configure the effect
to be applied to items owned by the actor instead of the actor itself. It is possible
to select the items to which to apply the effect via matching by name, or via a condition
expression, that provides similar capabilities as the evaluation of mathematical
expressions in rolls. Data from the Actor, Item, and Active Effect can be accessed
similar to how properties are accessed in roll formulas (using the prefixes `@actor`,
`@item`, and `@effect`). For example, in order to apply an effect to all ranged
weapons, the conditions would be
```js
'@item.type' === 'weapon' && '@item.data.attackType' === 'ranged'
```
World data (including compendium packs) is migrated automatically. In order to also migrate packs
provided by modules, you can use the following macro:
```js
const pack = game.packs.get("<name-of-the-module>.<name-of-the-pack>");
game.ds4.migration.migrateCompendiumFromTo(pack, 4, 5);
```