mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 07:59:03 +01:00
Added reroll icon
This commit is contained in:
parent
b44d4695ad
commit
87d4ec0c7e
2 changed files with 7 additions and 2 deletions
|
|
@ -195,11 +195,15 @@ export default class DamageRoll extends DHRoll {
|
||||||
results.splice(Number(result) + 1, 0, newResult[0]);
|
results.splice(Number(result) + 1, 0, newResult[0]);
|
||||||
|
|
||||||
const rerolledDice = parsedRoll.dice.map((x, index) => {
|
const rerolledDice = parsedRoll.dice.map((x, index) => {
|
||||||
if (index !== Number(dice)) return { ...x, dice: x.denomination };
|
const isRerollDice = index === Number(dice);
|
||||||
|
if (!isRerollDice) return { ...x, dice: x.denomination };
|
||||||
return {
|
return {
|
||||||
dice: parsedRoll.dice[dice].denomination,
|
dice: parsedRoll.dice[dice].denomination,
|
||||||
total: parsedRoll.dice[dice].total,
|
total: parsedRoll.dice[dice].total,
|
||||||
results: results
|
results: results.map(result => ({
|
||||||
|
...result,
|
||||||
|
hasRerolls: result.hasRerolls || isRerollDice
|
||||||
|
}))
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
class="dice reroll-button {{../dice}}"
|
class="dice reroll-button {{../dice}}"
|
||||||
data-die-index="0" data-type="damage" data-damage-type="{{@../../../key}}" data-part="{{@../../key}}" data-dice="{{@../key}}" data-result="{{@key}}"
|
data-die-index="0" data-type="damage" data-damage-type="{{@../../../key}}" data-part="{{@../../key}}" data-dice="{{@../key}}" data-result="{{@key}}"
|
||||||
>
|
>
|
||||||
|
{{#if hasRerolls}}<i class="fa-solid fa-dice dice-rerolled" data-tooltip="{{localize "Rerolled"}}"></i>{{/if}}
|
||||||
{{result}}
|
{{result}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue