Fixed so that the description message always comes first with the action workflow

This commit is contained in:
WBHarry 2026-02-01 21:05:50 +01:00
parent 668dbdf8f4
commit 4f52d541b4
3 changed files with 10 additions and 1 deletions

View file

@ -229,7 +229,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
if (Hooks.call(`${CONFIG.DH.id}.postUseAction`, this, config) === false) return;
if (this.chatDisplay) await this.toChat();
if (this.chatDisplay && !config.actionChatMessageHandled) await this.toChat();
return config;
}

View file

@ -68,6 +68,8 @@ export default class DamageField extends fields.SchemaField {
const damageResult = await CONFIG.Dice.daggerheart.DamageRoll.build(damageConfig);
if (!damageResult) return false;
if (damageResult.actionChatMessageHandled) config.actionChatMessageHandled = true;
config.damage = damageResult.damage;
config.message ??= damageConfig.message;
}

View file

@ -96,6 +96,13 @@ 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();
config.actionChatMessageHandled = true;
}
const cls = getDocumentClass('ChatMessage'),
msgData = {
type: this.messageType,