mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Fix party rerenders from shields and weapons (#1899)
This commit is contained in:
parent
b91d943dd1
commit
d152bfc906
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 */
|
||||
static migrateDocumentData(source) {
|
||||
if (!source.system.armor) {
|
||||
|
|
|
|||
|
|
@ -112,10 +112,22 @@ export default class DhpActor extends Actor {
|
|||
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) {
|
||||
super._onUpdate(changes, options, userId);
|
||||
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) {
|
||||
super._onDelete(options, userId);
|
||||
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