mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
* Temp * Finished Evolved * Fixed hybrid * Changed generalConfig.tiers to be number based * Weaponhandling while in beastform * Added unarmed strike in sidebar * Added DamageEnricher * Added effect enricher * Corrected downtime buttons and actions * Added BeastformTooltip * Split the BeastformDialog into parts with tabs * Added temp beastform features * rollData change * Improvement * character.getRollData cleanup
57 lines
2 KiB
JavaScript
57 lines
2 KiB
JavaScript
import DHBaseItemSheet from '../api/base-item.mjs';
|
|
import ItemAttachmentSheet from '../api/item-attachment-sheet.mjs';
|
|
|
|
export default class ArmorSheet extends ItemAttachmentSheet(DHBaseItemSheet) {
|
|
/**@inheritdoc */
|
|
static DEFAULT_OPTIONS = {
|
|
classes: ['armor'],
|
|
tagifyConfigs: [
|
|
{
|
|
selector: '.features-input',
|
|
options: () => CONFIG.DH.ITEM.armorFeatures,
|
|
callback: ArmorSheet.#onFeatureSelect
|
|
}
|
|
]
|
|
};
|
|
|
|
/**@override */
|
|
static PARTS = {
|
|
header: { template: 'systems/daggerheart/templates/sheets/items/armor/header.hbs' },
|
|
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
|
description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' },
|
|
actions: {
|
|
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-actions.hbs',
|
|
scrollable: ['.actions']
|
|
},
|
|
settings: {
|
|
template: 'systems/daggerheart/templates/sheets/items/armor/settings.hbs',
|
|
scrollable: ['.settings']
|
|
},
|
|
effects: {
|
|
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-effects.hbs',
|
|
scrollable: ['.effects']
|
|
},
|
|
...super.PARTS
|
|
};
|
|
|
|
/**@inheritdoc */
|
|
async _preparePartContext(partId, context) {
|
|
await super._preparePartContext(partId, context);
|
|
|
|
switch (partId) {
|
|
case 'settings':
|
|
context.features = this.document.system.armorFeatures.map(x => x.value);
|
|
break;
|
|
}
|
|
|
|
return context;
|
|
}
|
|
|
|
/**
|
|
* Callback function used by `tagifyElement`.
|
|
* @param {Array<Object>} selectedOptions - The currently selected tag objects.
|
|
*/
|
|
static async #onFeatureSelect(selectedOptions) {
|
|
await this.document.update({ 'system.armorFeatures': selectedOptions.map(x => ({ value: x.value })) });
|
|
}
|
|
}
|