diff --git a/lang/en.json b/lang/en.json index 56207e34..b86b4738 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1874,6 +1874,7 @@ "multiclass": "Multiclass", "newCategory": "New Category", "none": "None", + "noTarget": "No current target", "partner": "Partner", "proficiency": "Proficiency", "quantity": "Quantity", diff --git a/module/applications/dialogs/d20RollDialog.mjs b/module/applications/dialogs/d20RollDialog.mjs index 9075c454..4b8749a3 100644 --- a/module/applications/dialogs/d20RollDialog.mjs +++ b/module/applications/dialogs/d20RollDialog.mjs @@ -7,7 +7,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio this.roll = roll; this.config = config; this.config.experiences = []; - this.reactionOverride = config.roll.type === 'reaction'; + this.reactionOverride = config.roll?.type === 'reaction'; if (config.source?.action) { this.item = config.data.parent.items.get(config.source.item) ?? config.data.parent; @@ -149,16 +149,16 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio static toggleReaction() { if (this.config.roll) { this.reactionOverride = !this.reactionOverride; + this.config.roll.type = this.reactionOverride + ? CONFIG.DH.ITEM.actionTypes.reaction.id + : this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id + ? null + : this.config.roll.type; this.render(); } } static async submitRoll() { - this.config.roll.type = this.reactionOverride - ? CONFIG.DH.ITEM.actionTypes.reaction.id - : this.config.roll.type === CONFIG.DH.ITEM.actionTypes.reaction.id - ? null - : this.config.roll.type; await this.close({ submitted: true }); } diff --git a/module/dice/d20Roll.mjs b/module/dice/d20Roll.mjs index f65a0eff..85d9f277 100644 --- a/module/dice/d20Roll.mjs +++ b/module/dice/d20Roll.mjs @@ -142,6 +142,7 @@ export default class D20Roll extends DHRoll { static postEvaluate(roll, config = {}) { const data = super.postEvaluate(roll, config); + data.type = config.roll?.type; if (config.targets?.length) { config.targetSelection = true; config.targets.forEach(target => { diff --git a/module/dice/damageRoll.mjs b/module/dice/damageRoll.mjs index b805bdbd..f916dde3 100644 --- a/module/dice/damageRoll.mjs +++ b/module/dice/damageRoll.mjs @@ -16,11 +16,7 @@ export default class DamageRoll extends DHRoll { for (const roll of config.roll) await roll.roll.evaluate(); } roll._evaluated = true; - const parts = []; - for (let r of config.roll) { - const part = this.postEvaluate(r); - parts.push(part); - } + const parts = config.roll.map(r => this.postEvaluate(r)); config.roll = this.unifyDamageRoll(parts); } diff --git a/module/dice/dhRoll.mjs b/module/dice/dhRoll.mjs index 1da90d2f..c9cbb069 100644 --- a/module/dice/dhRoll.mjs +++ b/module/dice/dhRoll.mjs @@ -74,9 +74,7 @@ export default class DHRoll extends Roll { } static postEvaluate(roll, config = {}) { - console.log(roll, config) return { - type: config.roll.type, total: roll.total, formula: roll.formula, dice: roll.dice.map(d => ({ @@ -188,7 +186,7 @@ export default class DHRoll extends Roll { export const registerRollDiceHooks = () => { Hooks.on(`${CONFIG.DH.id}.postRollDuality`, async (config, message) => { - const hopeFearAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).hopeFear; + const hopeFearAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).hopeFear; if ( !config.source?.actor || (game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) || diff --git a/styles/less/ui/chat/chat-temp.less b/styles/less/ui/chat/chat-temp.less index d185966f..46e76f27 100644 --- a/styles/less/ui/chat/chat-temp.less +++ b/styles/less/ui/chat/chat-temp.less @@ -182,6 +182,10 @@ } } } + + i { + text-align: center; + } .roll-target { display: flex; diff --git a/templates/ui/chat/parts/damage-part.hbs b/templates/ui/chat/parts/damage-part.hbs index fbaebbfc..c7d0644c 100644 --- a/templates/ui/chat/parts/damage-part.hbs +++ b/templates/ui/chat/parts/damage-part.hbs @@ -2,70 +2,59 @@