mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +02:00
Fix party rerenders from shields and weapons
This commit is contained in:
parent
ab412367f9
commit
6a4f682938
2 changed files with 14 additions and 12 deletions
|
|
@ -141,16 +141,6 @@ export default class DHArmor extends AttachableItem {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_onUpdate(a, b, c) {
|
|
||||||
super._onUpdate(a, b, c);
|
|
||||||
|
|
||||||
if (this.actor?.type === 'character') {
|
|
||||||
for (const party of this.actor.parties) {
|
|
||||||
party.render();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
static migrateDocumentData(source) {
|
static migrateDocumentData(source) {
|
||||||
if (!source.system.armor) {
|
if (!source.system.armor) {
|
||||||
|
|
|
||||||
|
|
@ -112,10 +112,22 @@ export default class DhpActor extends Actor {
|
||||||
this.updateSource(update);
|
this.updateSource(update);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Perform a render, debounced in order to prevent overloading repeat render requests */
|
||||||
|
renderDebounced = foundry.utils.debounce(options => {
|
||||||
|
return this.render(options);
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
_onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId) {
|
||||||
|
super._onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId);
|
||||||
|
for (const party of this.parties) {
|
||||||
|
party.renderDebounced({ parts: ['partyMembers'] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_onUpdate(changes, options, userId) {
|
_onUpdate(changes, options, userId) {
|
||||||
super._onUpdate(changes, options, userId);
|
super._onUpdate(changes, options, userId);
|
||||||
for (const party of this.parties) {
|
for (const party of this.parties) {
|
||||||
party.render({ parts: ['partyMembers'] });
|
party.renderDebounced({ parts: ['partyMembers'] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -134,7 +146,7 @@ export default class DhpActor extends Actor {
|
||||||
_onDelete(options, userId) {
|
_onDelete(options, userId) {
|
||||||
super._onDelete(options, userId);
|
super._onDelete(options, userId);
|
||||||
for (const party of this.parties) {
|
for (const party of this.parties) {
|
||||||
party.render({ parts: ['partyMembers'] });
|
party.renderDebounced({ parts: ['partyMembers'] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue