mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-06 04:44:16 +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
|
|
@ -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