[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

@ -107,6 +107,13 @@ export default function DHApplicationMixin(Base) {
tagifyConfigs: []
};
/**
* Related documents that should cause a rerender of this application when updated.
*/
get relatedDocs() {
return [];
}
/* -------------------------------------------- */
/**@inheritdoc */
@ -117,9 +124,17 @@ export default function DHApplicationMixin(Base) {
/**@inheritdoc */
async _onFirstRender(context, options) {
await super._onFirstRender(context, options);
this.relatedDocs.filter(doc => doc).map(doc => (doc.apps[this.id] = this));
if (!!this.options.contextMenus.length) this._createContextMenus();
}
/** @inheritDoc */
_onClose(options) {
super._onClose(options);
this.relatedDocs.filter(doc => doc).map(doc => delete doc.apps[this.id]);
}
/**@inheritdoc */
async _onRender(context, options) {
await super._onRender(context, options);
@ -285,7 +300,7 @@ export default function DHApplicationMixin(Base) {
icon: 'fa-solid fa-pen-to-square',
condition: target => {
const doc = getDocFromElement(target);
return !doc.hasOwnProperty('systemPath') || doc.inCollection
return !doc.hasOwnProperty('systemPath') || doc.inCollection;
},
callback: target => getDocFromElement(target).sheet.render({ force: true })
}