Exec Save message as GM for players

This commit is contained in:
Dapoolp 2025-07-28 15:43:50 +02:00
parent 9674b90967
commit c36fa38df2
2 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,5 @@
import { emitAsGM, GMUpdateEvent } from "../../systemRegistration/socket.mjs";
export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLog {
constructor(options) {
super(options);
@ -98,7 +100,16 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
if (message.system.source.item && message.system.source.action) {
const action = this.getAction(actor, message.system.source.item, message.system.source.action);
if (!action || !action?.hasSave) return;
action.rollSave(token.actor, event, message).then(result => action.updateSaveMessage(result, message, token.id));
action.rollSave(token.actor, event, message).then(result => emitAsGM(
GMUpdateEvent.UpdateSaveMessage,
action.updateSaveMessage.bind(action, result, message, token.id),
{
action: action.uuid,
message: message._id,
token: token.id,
result
}
));
}
}