[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:
WBHarry 2025-07-26 00:37:30 +02:00 committed by GitHub
parent fcba5041e9
commit 2a4777f1a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 648 additions and 489 deletions

View file

@ -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;
}
}