Changed to instead render the description in the roll message

This commit is contained in:
WBHarry 2026-02-02 00:38:26 +01:00
parent 4f52d541b4
commit 357b94c128
8 changed files with 145 additions and 121 deletions

View file

@ -98,8 +98,14 @@ export default class DHRoll extends Roll {
static async toMessage(roll, config) {
const item = config.data.parent?.items?.get?.(config.source.item) ?? null;
const action = item ? item.system.actions.get(config.source.action) : null;
if (action?.chatDisplay && !config.actionChatMessageHandled) {
await action.toChat();
let actionDescription = null;
if (action?.chatDisplay) {
actionDescription = action
? await foundry.applications.ux.TextEditor.implementation.enrichHTML(action.description, {
relativeTo: config.data,
rollData: config.data.getRollData?.() ?? {}
})
: null;
config.actionChatMessageHandled = true;
}
@ -110,7 +116,7 @@ export default class DHRoll extends Roll {
title: roll.title,
speaker: cls.getSpeaker({ actor: roll.data?.parent }),
sound: config.mute ? null : CONFIG.sounds.dice,
system: config,
system: { ...config, actionDescription },
rolls: [roll]
};