Skip to content

Commit

Permalink
Add synchronization with fight dialog with actors
Browse files Browse the repository at this point in the history
When actor data changes, things synchronize correctly in the fight
dialog. This specifically pertains to things like portrait, available
weapons, and reflexes.
  • Loading branch information
StasTserk committed Oct 3, 2020
1 parent c9b88aa commit b01fe27
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions module/dialogs/fight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ export class FightDialog extends ExtendedTestDialog<FightDialogData> {
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() {
Expand Down

0 comments on commit b01fe27

Please sign in to comment.