[Feature] Damage-Reroll (#753)

* Added rerolls for damage dice in chat

* Fixed multiple dice

* Added reroll icon

* Fixed new style of dialog
This commit is contained in:
WBHarry 2025-08-10 01:32:12 +02:00 committed by GitHub
parent 2aaab73699
commit 300719c116
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 1094 additions and 167 deletions

View file

@ -0,0 +1,35 @@
<div class="reroll-outer-container">
{{#each damage}}
<h2>{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' @key '.name')}}</h2>
{{#each this}}
<div class="dices-container">
{{#each this}}
<fieldset class="dice-outer-container">
<legend>
<input class="to-reroll-input" type="checkbox" data-type="{{@../../key}}" data-part="{{@../key}}" data-dice="{{@key}}" {{checked this.toReroll}} />
<i class="fa-solid fa-dice"></i>
<span>{{this.selectedResults}}/{{this.maxSelected}} Selected</span>
</legend>
<div class="dice-container">
{{#each this.results}}
<div
class="result-container {{../dice}} {{#if this.active}}selected{{/if}}"
data-action="selectRoll" data-type="{{@../../../key}}" data-part="{{@../../key}}" data-dice="{{@../key}}" data-result="{{@key}}"
>
{{this.result}}
{{#if this.active}}
<a class="to-reroll-result" data-action="toggleResult" data-type="{{@../../../key}}" data-part="{{@../../key}}" data-dice="{{@../key}}" data-result="{{@key}}">
<input class="to-reroll-result-input" type="checkbox" {{checked this.toReroll}} />
<i class="fa-solid fa-dice"></i>
</a>
{{/if}}
</div>
{{/each}}
</div>
</fieldset>
{{/each}}
</div>
{{/each}}
{{/each}}
</div>

View file

@ -0,0 +1,4 @@
<footer>
<button type="button" data-action="doReroll" {{disabled disabledReroll}}>{{localize "Reroll"}} <i class="fa-solid fa-dice"></i></button>
<button type="button" data-action="save" {{disabled saveDisabled}}>{{localize "DAGGERHEART.APPLICATIONS.RerollDialog.acceptCurrentRolls"}}</button>
</footer>

View file

@ -0,0 +1,35 @@
<div class="reroll-outer-container">
{{#each damage}}
<h2>{{localize (concat 'DAGGERHEART.CONFIG.HealingType.' @key '.name')}}</h2>
{{#each this}}
<div class="dices-container">
{{#each this}}
<fieldset class="dice-outer-container">
<legend>
<input class="to-reroll-input" type="checkbox" data-type="{{@../../key}}" data-part="{{@../key}}" data-dice="{{@key}}" {{checked this.toReroll}} />
<i class="fa-solid fa-dice"></i>
<span>{{this.selectedResults}}/{{this.results.length}} Selected</span>
</legend>
<div class="dice-container">
{{#each this.results}}
<div
class="result-container {{../dice}} {{#if this.active}}selected{{/if}}"
data-action="selectRoll" data-type="{{@../../../key}}" data-part="{{@../../key}}" data-dice="{{@../key}}" data-result="{{@key}}"
>
{{this.result}}
{{#if this.active}}
<a class="to-reroll-result" data-action="toggleResult" data-type="{{@../../../key}}" data-part="{{@../../key}}" data-dice="{{@../key}}" data-result="{{@key}}">
<input class="to-reroll-result-input" type="checkbox" {{checked this.toReroll}} />
<i class="fa-solid fa-dice"></i>
</a>
{{/if}}
</div>
{{/each}}
</div>
</fieldset>
{{/each}}
</div>
{{/each}}
{{/each}}
</div>