From b01fe274cb24b1d3b1f7de5be60283a57bbd3248 Mon Sep 17 00:00:00 2001 From: Stas Tserkovny Date: Fri, 2 Oct 2020 18:07:29 -0600 Subject: [PATCH] Add synchronization with fight dialog with actors When actor data changes, things synchronize correctly in the fight dialog. This specifically pertains to things like portrait, available weapons, and reflexes. --- module/dialogs/fight.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module/dialogs/fight.ts b/module/dialogs/fight.ts index b4905b38..04ba7c5d 100644 --- a/module/dialogs/fight.ts +++ b/module/dialogs/fight.ts @@ -190,6 +190,16 @@ export class FightDialog extends ExtendedTestDialog { this.render(); } }); + Hooks.on("updateActor", (actor: BWActor) => { + if (this.data.actors.includes(actor)) { + const index = this.data.actors.indexOf(actor); + this.data.data.participants[index] = Object.assign( + this.data.data.participants[index], + toParticipantData(actor) + ); + this.render(); + } + }); } private _syncActors() {