daggerheart/templates/ui/chat/adversary-roll.hbs
WBHarry 6301e575e3
[Feature] Allow Dice Reroll in ChatMessage (#395)
* Troubleshooting

Created test button in 'duality-roll.hbs' and functionality in chatLog.mjs

* Updated functionality

dialog recheck.

* Update duality-roll.hbs

testing toggle on specific areas so only tooltip is triggered.

Rest of CSS functionality not affected.

* Redoing Dice Reroll functionality

Attempting something new

* The rise of NaNs

Resolved Dice Parsing Errors, now dealing with parsing errors from system values.

* Forcing string evaluation for testing

* Fixed rerolling of duality dice

* Fixed message.rolls not being updated

* Added support for d20 rolls

* PR fixes

---------

Co-authored-by: Nikhil Nagarajan <potter.nikhil@gmail.com>
2025-07-23 01:01:21 +02:00

58 lines
No EOL
2.6 KiB
Handlebars

<div class="dice-roll daggerheart chat roll" data-action="expandRoll">
<div class="dice-flavor">{{title}}</div>
<div class="dice-result">
<div class="dice-formula">{{roll.formula}}</div>
<div class="dice-tooltip">
<div class="wrapper">
<section class="tooltip-part">
<div class="dice">
{{#each roll.dice as | dice index |}}
<header class="part-header flexrow">
<span class="part-formula">{{formula}}</span>
<span class="part-total">{{total}}</span>
</header>
<div class="flexrow">
<ol class="dice-rolls rerollable">
<button type="checkbox" class="reroll-button" data-die-index="0" data-tooltip="{{localize "DAGGERHEART.GENERAL.reroll"}}">
{{#each results as |result index|}}
<li class="roll die {{../dice}}{{#if discarded}} discarded{{/if}} min">{{result.result}}</li>
{{/each}}
</button>
</ol>
</div>
{{/each}}
</div>
</section>
</div>
</div>
<div class="dice-total">
<div class="dice-total-value">{{roll.total}}</div>
</div>
</div>
</div>
<fieldset class="dice-roll daggerheart chat roll expanded{{#unless damage.roll}} hidden{{/unless}}" data-action="expandRoll">
<legend class="dice-flavor">{{localize "DAGGEHEART.GENERAL.damage"}}</legend>
<div class="dice-result">
<div class="dice-tooltip">
<div class="wrapper">
{{> 'systems/daggerheart/templates/ui/chat/parts/damage-chat.hbs' damage=damage noTitle=true}}
</div>
</div>
</div>
</fieldset>
{{> 'systems/daggerheart/templates/ui/chat/parts/target-chat.hbs'}}
{{#if hasDamage}}
<div class="dice-roll daggerheart chat roll">
<div class="dice-result">
{{#if damage.roll}}
<div class="dice-actions">
<button class="damage-button">{{localize "DAGGERHEART.UI.Chat.damageRoll.dealDamage"}}</button>
</div>
{{else}}
<div class="flexrow">
<button class="duality-action duality-action-damage" data-value="{{roll.total}}"><span>{{localize "DAGGERHEART.UI.Chat.damageRoll.rollDamage"}}</span></button>
</div>
{{/if}}
</div>
</div>
{{/if}}