mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
* Restructured all the files * Moved build/daggerheart.js to ./daggerheart.js. Changed rollup to use the css file instead of the less * Restored build/ folder * Mvoed config out form under application * Moved roll.mjs to module/dice and renamed to dhRolls.mjs * Update module/canvas/placeables/_module.mjs Co-authored-by: joaquinpereyra98 <24190917+joaquinpereyra98@users.noreply.github.com> * Le massive export update * Removed unncessary import --------- Co-authored-by: joaquinpereyra98 <24190917+joaquinpereyra98@users.noreply.github.com>
51 lines
1.7 KiB
JavaScript
51 lines
1.7 KiB
JavaScript
import DHBaseItemSheet from '../api/base-item.mjs';
|
|
|
|
export default class WeaponSheet extends 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']
|
|
}
|
|
};
|
|
|
|
/**@inheritdoc */
|
|
async _preparePartContext(partId, context) {
|
|
super._preparePartContext(partId, context);
|
|
|
|
switch (partId) {
|
|
case 'settings':
|
|
context.features = this.document.system.features.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.features': selectedOptions.map(x => ({ value: x.value })) });
|
|
}
|
|
}
|