mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 06:26:13 +01:00
[Fix] RollMessage Order (#1626)
* Fixed so that the description message always comes first with the action workflow
* Changed to instead render the description in the roll message
* Made the action config title not get changed in d20rolldialog if it's not a trait roll
* Initial chat message description design change
* Revert "Initial chat message description design change"
This reverts commit f4f5fd6c24.
* .
This commit is contained in:
parent
c8d1ea1460
commit
735ed4c214
12 changed files with 201 additions and 127 deletions
|
|
@ -96,6 +96,19 @@ 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;
|
||||
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;
|
||||
}
|
||||
|
||||
const cls = getDocumentClass('ChatMessage'),
|
||||
msgData = {
|
||||
type: this.messageType,
|
||||
|
|
@ -103,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]
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue