mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 05:01:08 +01:00
[Fix] Itemlink Redux Revengeance (#399)
* 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
This commit is contained in:
parent
fcba5041e9
commit
2a4777f1a0
61 changed files with 648 additions and 489 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import ForeignDocumentUUIDArrayField from '../fields/foreignDocumentUUIDArrayField.mjs';
|
||||
import BaseDataItem from './base.mjs';
|
||||
import ItemLinkFields from '../../data/fields/itemLinkFields.mjs';
|
||||
|
||||
export default class DHAncestry extends BaseDataItem {
|
||||
/** @inheritDoc */
|
||||
|
|
@ -15,23 +15,15 @@ export default class DHAncestry extends BaseDataItem {
|
|||
static defineSchema() {
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
features: new ForeignDocumentUUIDArrayField({ type: 'Item' })
|
||||
features: new ItemLinkFields()
|
||||
};
|
||||
}
|
||||
|
||||
get primaryFeature() {
|
||||
return (
|
||||
this.features.find(x => x?.system?.subType === CONFIG.DH.ITEM.featureSubTypes.primary) ??
|
||||
(this.features.filter(x => !x).length > 0 ? {} : null)
|
||||
);
|
||||
return this.features.find(x => x.type === CONFIG.DH.ITEM.featureSubTypes.primary)?.item;
|
||||
}
|
||||
|
||||
get secondaryFeature() {
|
||||
return (
|
||||
this.features.find(x => x?.system?.subType === CONFIG.DH.ITEM.featureSubTypes.secondary) ??
|
||||
(this.features.filter(x => !x || x.system.subType === CONFIG.DH.ITEM.featureSubTypes.primary).length > 1
|
||||
? {}
|
||||
: null)
|
||||
);
|
||||
return this.features.find(x => x.type === CONFIG.DH.ITEM.featureSubTypes.secondary)?.item;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue