mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
* Small random fixes * Added use of ItemLinkFields * Multiclass levelup fixes * Fixed our onCreate methods unintentionally being run on all clients * Remade apps handling * Added for all class items and subclass * Restored foreignDocumentUuidField * Improved * PR fxies * Fixed tooltip enrichment * . * Reverted silly change
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import DHHeritageSheet from '../api/heritage-sheet.mjs';
|
|
|
|
export default class AncestrySheet extends DHHeritageSheet {
|
|
/**@inheritdoc */
|
|
static DEFAULT_OPTIONS = {
|
|
classes: ['ancestry']
|
|
};
|
|
|
|
/**@inheritdoc */
|
|
static PARTS = {
|
|
header: { template: 'systems/daggerheart/templates/sheets/items/ancestry/header.hbs' },
|
|
...super.PARTS,
|
|
features: { template: 'systems/daggerheart/templates/sheets/items/ancestry/features.hbs' }
|
|
};
|
|
|
|
/**@inheritdoc */
|
|
get relatedDocs() {
|
|
return this.document.system.features.map(x => x.item);
|
|
}
|
|
|
|
/* -------------------------------------------- */
|
|
/* Application Drag/Drop */
|
|
/* -------------------------------------------- */
|
|
|
|
/**
|
|
* On drop on the item.
|
|
* @param {DragEvent} event - The drag event
|
|
*/
|
|
async _onDrop(event) {
|
|
const target = event.target.closest('fieldset.drop-section');
|
|
const typeField =
|
|
this.document.system[target.dataset.type === 'primary' ? 'primaryFeature' : 'secondaryFeature'];
|
|
|
|
if (!typeField) {
|
|
super._onDrop(event);
|
|
}
|
|
}
|
|
}
|