diff --git a/lang/en.json b/lang/en.json index 4d3927bc..41c8d45f 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1170,6 +1170,7 @@ }, "Roll": { "attack": "Attack Roll", + "difficulty": "Roll (Difficulty {difficulty})", "primaryWeaponAttack": "Primary Weapon Attack Roll", "secondaryWeaponAttack": "Secondary Weapon Attack Roll", "spellcast": "Spellcast Roll", @@ -1274,6 +1275,7 @@ "single": "Experience", "plural": "Experiences" }, + "failure": "Failure", "fear": "Fear", "features": "Features", "formula": "Formula", @@ -1309,6 +1311,7 @@ "scalable": "Scalable", "situationalBonus": "Situational Bonus", "stress": "Stress", + "success": "Success", "take": "Take", "Target": { "single": "Target", diff --git a/module/documents/chatMessage.mjs b/module/documents/chatMessage.mjs index 409b4dd0..46f95633 100644 --- a/module/documents/chatMessage.mjs +++ b/module/documents/chatMessage.mjs @@ -1,10 +1,10 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage { async renderHTML() { if (this.system.messageTemplate) - this.content = await foundry.applications.handlebars.renderTemplate( - this.system.messageTemplate, - this.system - ); + this.content = await foundry.applications.handlebars.renderTemplate(this.system.messageTemplate, { + ...this.system, + _source: this.system._source + }); /* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */ const html = await super.renderHTML(); diff --git a/module/enrichers/DualityRollEnricher.mjs b/module/enrichers/DualityRollEnricher.mjs index 094a6948..63d6ff4c 100644 --- a/module/enrichers/DualityRollEnricher.mjs +++ b/module/enrichers/DualityRollEnricher.mjs @@ -27,13 +27,15 @@ export function getDualityMessage(roll) { data-title="${label}" data-label="${dataLabel}" data-hope="${roll.hope ?? 'd12'}" - data-fear="${roll.fear ?? 'd12'}" + data-fear="${roll.fear ?? 'd12'}" + ${roll.difficulty ? `data-difficulty="${roll.difficulty}"` : ''} ${roll.trait && abilities[roll.trait] ? `data-trait="${roll.trait}"` : ''} ${roll.advantage ? 'data-advantage="true"' : ''} ${roll.disadvantage ? 'data-disadvantage="true"' : ''} > ${label} + ${roll.difficulty ? `(${roll.difficulty})` : ''} `; @@ -43,7 +45,8 @@ export function getDualityMessage(roll) { export const renderDualityButton = async event => { const button = event.currentTarget, traitValue = button.dataset.trait?.toLowerCase(), - target = getCommandTarget(); + target = getCommandTarget(), + difficulty = button.dataset.difficulty; if (!target) return; const config = { @@ -52,6 +55,7 @@ export const renderDualityButton = async event => { roll: { modifier: traitValue ? target.system.traits[traitValue].value : null, label: button.dataset.label, + difficulty: difficulty, type: button.dataset.actionType ?? null // Need check }, chatMessage: { diff --git a/styles/less/dialog/dice-roll/roll-selection.less b/styles/less/dialog/dice-roll/roll-selection.less index af6c3c20..5e36990e 100644 --- a/styles/less/dialog/dice-roll/roll-selection.less +++ b/styles/less/dialog/dice-roll/roll-selection.less @@ -131,13 +131,17 @@ display: flex; align-items: center; gap: 16px; + height: 32px; .roll-mode-select { width: min-content; + height: 100%; } button { flex: 1; + height: 100%; + font-family: @font-body; } } } diff --git a/templates/dialogs/dice-roll/rollSelection.hbs b/templates/dialogs/dice-roll/rollSelection.hbs index ca918145..e3129e30 100644 --- a/templates/dialogs/dice-roll/rollSelection.hbs +++ b/templates/dialogs/dice-roll/rollSelection.hbs @@ -136,14 +136,22 @@ {{/unless}} + {{localize "DAGGERHEART.GENERAL.formula"}}: {{@root.formula}} +