From a1f9d597ed67829d051a54e796a10ca6d0bf96f5 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Mon, 22 Dec 2025 01:00:49 +0100 Subject: [PATCH] Fixed so that players rolling reactions will update the message --- module/data/fields/actionField.mjs | 2 +- module/dice/dhRoll.mjs | 2 +- module/systemRegistration/socket.mjs | 11 +++++++---- templates/dialogs/dice-roll/header.hbs | 2 +- templates/sheets/global/partials/inventory-item.hbs | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/module/data/fields/actionField.mjs b/module/data/fields/actionField.mjs index 2d968fe0..6257da38 100644 --- a/module/data/fields/actionField.mjs +++ b/module/data/fields/actionField.mjs @@ -262,7 +262,7 @@ export function ActionMixin(Base) { async toChat(origin) { const cls = getDocumentClass('ChatMessage'); const systemData = { - title: game.i18n.localize('DAGGERHEART.CONFIG.ActionType.action'), + title: game.i18n.localize('DAGGERHEART.CONFIG.FeatureForm.action'), origin: origin, action: { name: this.name, diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index ec289941..6b7dce6f 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -305,7 +305,7 @@ export const registerRollDiceHooks = () => { if (!config.roll.hasOwnProperty('success') && !config.targets?.length) return; - const rollResult = config.roll.success || config.targets.some(t => t.hit), + const rollResult = config.roll.success || config.targets?.some(t => t.hit), looseSpotlight = !rollResult || config.roll.result.duality === -1; if (looseSpotlight && game.combat?.active) { diff --git a/module/systemRegistration/socket.mjs b/module/systemRegistration/socket.mjs index 27bf48c5..046f1b68 100644 --- a/module/systemRegistration/socket.mjs +++ b/module/systemRegistration/socket.mjs @@ -73,10 +73,13 @@ export const registerSocketHooks = () => { Hooks.callAll(socketEvent.Refresh, { refreshType: RefreshType.Countdown }); break; case GMUpdateEvent.UpdateSaveMessage: - const action = await fromUuid(data.update.action), - message = game.messages.get(data.update.message); - if (!action || !message) return; - action.updateSaveMessage(data.update.result, message, data.update.token); + const message = game.messages.get(data.update.message); + if (!message) return; + game.system.api.fields.ActionFields.SaveField.updateSaveMessage( + data.update.result, + message, + data.update.token + ); break; } diff --git a/templates/dialogs/dice-roll/header.hbs b/templates/dialogs/dice-roll/header.hbs index b2ca18cd..21967655 100644 --- a/templates/dialogs/dice-roll/header.hbs +++ b/templates/dialogs/dice-roll/header.hbs @@ -2,7 +2,7 @@

{{#if reactionOverride}} - {{localize "DAGGERHEART.CONFIG.ActionType.reaction"}} + {{localize "DAGGERHEART.CONFIG.FeatureForm.reaction"}} {{else}} {{ifThen rollConfig.headerTitle rollConfig.headerTitle rollConfig.title}} {{/if}} diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index d69b0abb..c2b2a241 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -136,7 +136,7 @@ {{localize (concat 'DAGGERHEART.ACTIONS.TYPES.' item.type '.name')}}

- {{localize (concat 'DAGGERHEART.CONFIG.ActionType.' item.actionType)}} + {{localize (concat 'DAGGERHEART.CONFIG.FeatureForm.' item.actionType)}}
{{/if}} @@ -146,7 +146,7 @@ {{localize 'DAGGERHEART.GENERAL.unarmed'}}
- {{localize 'DAGGERHEART.CONFIG.ActionType.action'}} + {{localize 'DAGGERHEART.CONFIG.FeatureForm.action'}}
{{/if}}