mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
* FIX: Add enritch to HTMLField FIX: Remove no-HTMLField from Manifest FIX: Convert Scar's HTMLField to StringField FIX: Remove unused HTMLField * REMOVE unused hanldebars helpers * FEAT: add inventory-fieldset-items-V2 and inventory-item-V2 partials for Actors * FIX showLabels to hideTags * FEAT: add template to items sheet * FEAT: add effects tabs on ItemSheet * FEAT: add context menus for all inventory-items * FEAT: add resources to inventory-item template * FEAT: add enritch on inventory-item description FEAT: add extensible behavior on inventory-item-content FEAT: add fade effect on item-img to roll-itmg * FEAT: add eritch to NPC description FIX: missing htmlFieldss on manfiest FIX: add misisng localizations * FIX_ minor fixes * Little resource fix. Noone will notice ._. * FIX: remove default list styles FIX: .extended css reduce max-height, shorten animation duration to 0.5s, and set overflow to auto. FIX: set enriched=notes.enriche on notes.hbs FIX: set experience.value on sidebar.hbs FIX: move tooltip from item-img to img-portrait on inventory-item-V2.hbs REMOVE: unused files --------- Co-authored-by: Joaquin Pereyra <joaquinpereyra98@users.noreply.github.com> Co-authored-by: WBHarry <williambjrklund@gmail.com>
56 lines
2.1 KiB
JavaScript
56 lines
2.1 KiB
JavaScript
import DHBaseItemSheet from '../api/base-item.mjs';
|
|
import ItemAttachmentSheet from '../api/item-attachment-sheet.mjs';
|
|
|
|
export default class WeaponSheet extends ItemAttachmentSheet(DHBaseItemSheet) {
|
|
/**@inheritdoc */
|
|
static DEFAULT_OPTIONS = {
|
|
classes: ['weapon'],
|
|
tagifyConfigs: [
|
|
{
|
|
selector: '.features-input',
|
|
options: () => CONFIG.DH.ITEM.weaponFeatures,
|
|
callback: WeaponSheet.#onFeatureSelect
|
|
}
|
|
]
|
|
};
|
|
|
|
/**@override */
|
|
static PARTS = {
|
|
header: { template: 'systems/daggerheart/templates/sheets/items/weapon/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/weapon/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.weaponFeatures.map(x => x.value);
|
|
context.systemFields.attack.fields = this.document.system.attack.schema.fields;
|
|
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.weaponFeatures': selectedOptions.map(x => ({ value: x.value })) });
|
|
}
|
|
}
|