Synced "Gm Monitor" with actor updates

This commit is contained in:
Vlyan
2021-08-13 17:00:22 +02:00
parent d7059f09fa
commit 14d89f6943
9 changed files with 30 additions and 42 deletions

View File

@@ -186,7 +186,18 @@ export class BaseSheetL5r5e extends ActorSheet {
if (formData["data.description"]) {
formData["data.description"] = game.l5r5e.HelpersL5r5e.convertSymbols(formData["data.description"], true);
}
return super._updateObject(event, formData);
return super._updateObject(event, formData).then(() => {
// Notify the "Gm Monitor" if this actor is watched
if (game.settings.get("l5r5e", "gm-monitor-actors").find((e) => e === this.actor.id)) {
game.l5r5e.sockets.refreshAppId("l5r5e-gm-monitor");
if (game.user.isGM) {
Object.values(ui.windows)
.find((e) => e.id === "l5r5e-gm-monitor")
?.refresh();
}
}
});
}
/**