working on RnK

This commit is contained in:
Vlyan
2021-01-29 14:35:27 +01:00
parent c5e874c5ed
commit 30f71e31cd
13 changed files with 319 additions and 128 deletions

View File

@@ -1,5 +1,5 @@
<div class="l5r5e dice-roll">
{{#if isPublicRoll }}
{{#if isPublicRoll}}
{{#if l5r5e.stance}}
<div class="l5r5e profil">
@@ -45,6 +45,7 @@
<div class="l5r5e dice-result">
{{#if l5r5e.dicesTypes.l5r}}
<div class="l5r5e item-display dices-l5r">
{{!-- Dices list --}}
{{#each l5r5e.dices}}
{{#if this.diceTypeL5r}}
{{#each this.rolls}}
@@ -54,30 +55,41 @@
{{/each}}
{{!-- Roll & Keep Button --}}
{{#if l5r5e.canRnK}}
<button class="l5r5e chat-dice-rnk">{{localize "l5r5e.chatdices.roll_n_keep"}}</button>
{{/if}}
{{#l5r5e.summary}}
<ul>
<li>{{localize "l5r5e.chatdices.successes"}}: {{this.success}}</li>
{{!-- summary symbols --}}
<div>
{{#if success}}
<i class="i_success" title="{{localize "l5r5e.chatdices.successes"}}"></i> {{success}}
{{/if}}
{{#if explosive}}
<li>{{localize "l5r5e.chatdices.explosives"}}: {{this.explosive}}</li>
<i class="i_explosive" title="{{localize "l5r5e.chatdices.explosives"}}"></i> {{explosive}}
{{/if}}
{{#if opportunity}}
<li>{{localize "l5r5e.chatdices.opportunities"}}: {{this.opportunity}}</li>
<i class="i_opportunity" title="{{localize "l5r5e.chatdices.opportunities"}}"></i> {{opportunity}}
{{/if}}
{{#if strife}}
<li>{{localize "l5r5e.chatdices.strife"}}: {{this.strife}}</li>
<i class="i_strife" title="{{localize "l5r5e.chatdices.strife"}}"></i> {{strife}}
{{/if}}
</ul>
</div>
{{!-- Result text --}}
<div>
{{#ifCond totalSuccess '>=' difficulty}}
{{localize "l5r5e.chatdices.success_text"}} ({{totalBonus}} {{localize "l5r5e.chatdices.bonus_text"}})
{{else}}
{{localize "l5r5e.chatdices.fail_text"}}
{{/ifCond}}
</div>
{{/l5r5e.summary}}
</div>
{{/if}}
{{!-- Regular dices --}}
{{#if l5r5e.dicesTypes.std}}
<div class="l5r5e dices-std">
{{#each results}}
@@ -90,7 +102,6 @@
{{{tooltip}}}
<h4 class="l5r5e dice-total dice-total-std">{{total}}</h4>
{{/if}}
</div>
{{/if}}

View File

@@ -1,5 +1,4 @@
<form class="l5r5e roll-n-keep-dialog" autocomplete="off">
{{!-- Profil --}}
<div class="l5r5e profil">
<header class="part-header flexrow chat-profil">
@@ -38,53 +37,116 @@
</header>
</div>
{{!-- Discard & ReRoll --}}
<table>
<tr>
<td>
<fieldset class="dropbox discards" data-type="discard">
<legend class="section-header"><i class="fa fa-arrow-down" aria-hidden="true"></i> {{ localize 'l5r5e.roll_n_keep.discard_drop_here' }}</legend>
</fieldset>
</td>
<td>
&nbsp;
</td>
<td>
<fieldset class="dropbox rerolls" data-type="reroll">
<legend class="section-header"><i class="fa fa-arrow-down" aria-hidden="true"></i> {{ localize 'l5r5e.roll_n_keep.reroll_drop_here' }}</legend>
</fieldset>
</td>
</tr>
</table>
{{!-- Body --}}
{{#if options.editable}}
<table>
<tr>
{{!-- Face Rings --}}
<td>
<legend class="section-header">
<i class="fa fa-arrow-down" aria-hidden="true"></i> {{ localize 'l5r5e.roll_n_keep.swap_drop_here' }}
</legend>
{{!-- DiceList history --}}
<table>
{{#each data.dicesList as |item idxStep|}}
<tr>
{{#each item as |dice idxDie|}}
<td>
<div class="dice {{this.choice}} {{#ifCond (lookup ../../draggableList idxDie) '==' idxStep }}draggable{{/ifCond}}" data-step="{{idxStep}}" data-die="{{idxDie}}">
{{#if this.img}}
<img src="{{this.img}}" alt="{{idxStep}}_{{idxDie}}" />
{{/if}}
</div>
</td>
{{#each data.swapDiceFaces.rings}}
<div class="dice dropbox faces-change" data-type="swap" data-face="{{id}}" data-die="RingDie">
<img src="{{img}}" alt="{{id}}" />
</div>
{{/each}}
</td>
{{!-- Center --}}
<td>
{{!-- Discard & ReRoll --}}
<table>
<tr>
<td>
<fieldset class="dropbox discards" data-type="discard">
<legend class="section-header">
<i class="fa fa-arrow-down" aria-hidden="true"></i> {{ localize 'l5r5e.roll_n_keep.discard_drop_here' }}
</legend>
</fieldset>
</td>
<td>&nbsp;</td>
<td>
<fieldset class="dropbox rerolls" data-type="reroll">
<legend class="section-header">
<i class="fa fa-arrow-down" aria-hidden="true"></i> {{ localize 'l5r5e.roll_n_keep.reroll_drop_here' }}
</legend>
</fieldset>
</td>
</tr>
</table>
{{!-- DiceList history --}}
<table>
{{#each data.dicesList as |item idxStep|}}
<tr>
{{#each item as |dice idxDie|}}
<td>
<div
class="dice {{this.choice}} {{#ifCond ../../data.currentStep '==' idxStep }}draggable{{/ifCond}}"
data-step="{{idxStep}}"
data-die="{{idxDie}}"
>
{{#if this.img}}
<img src="{{this.img}}" alt="{{idxStep}}_{{idxDie}}" />
{{/if}}
</div>
</td>
{{/each}}
</tr>
{{/each}}
</table>
{{!-- Keep --}}
<table>
<tr>
<td>
<fieldset class="dropbox keeps" data-type="keep">
<legend class="section-header">
<i class="fa fa-arrow-down" aria-hidden="true"></i> {{ localize 'l5r5e.roll_n_keep.keep_drop_here' }}
</legend>
</fieldset>
</td>
</tr>
</table>
</td>
{{!-- Face Skills --}}
<td>
<legend class="section-header">
<i class="fa fa-arrow-down" aria-hidden="true"></i> {{ localize 'l5r5e.roll_n_keep.swap_drop_here' }}
</legend>
{{#each data.swapDiceFaces.skills}}
<div class="dice dropbox faces-change" data-type="swap" data-face="{{id}}" data-die="AbilityDie">
<img src="{{img}}" alt="{{id}}" />
</div>
{{/each}}
</td>
</tr>
</table>
<button id="finalize" name="finalize" type="button" {{#if data.submitDisabled}}disabled{{/if}}>
{{ localize 'l5r5e.roll_n_keep.bt_validate' }} <i class="fas fa-arrow-circle-right"></i>
</button>
{{else}}
{{!-- Non editable DiceList history (view for others players) --}}
<table>
{{#each data.dicesList as |item idxStep|}}
<tr>
{{#each item as |dice idxDie|}}
<td>
<div class="dice {{this.choice}}">
{{#if this.img}}
<img src="{{this.img}}" alt="{{idxStep}}_{{idxDie}}" />
{{/if}}
</div>
</td>
{{/each}}
</tr>
{{/each}}
</tr>
{{/each}}
</table>
{{!-- Keep --}}
<table>
<tr>
<td>
<fieldset class="dropbox keeps" data-type="keep">
<legend class="section-header"><i class="fa fa-arrow-down" aria-hidden="true"></i> {{ localize 'l5r5e.roll_n_keep.keep_drop_here' }}</legend>
</fieldset>
</td>
</tr>
</table>
<button id="finalize" name="finalize" type="button">{{ localize 'l5r5e.roll_n_keep.bt_validate' }} <i class='fas fa-arrow-circle-right'></i></button>
</table>
{{/if}}
</form>