Added support for rolling skill on spells

This commit is contained in:
2020-12-01 09:04:03 +01:00
parent cbafeede44
commit 836875459c
6 changed files with 81 additions and 18 deletions

View File

@@ -5,12 +5,12 @@
<div class="roll">
<div class="dice-roll">
{{#if closed}}
<div style="margin: auto;">
<div style="text-align: center; margin-bottom: 0.5rem;">
{{localize "ROLL.CLOSED"}}: {{closed}}
</div>
{{/if}}
{{#if opened}}
<div style="margin: auto;">
<div style="text-align: center; margin-bottom: 0.5rem;">
{{localize "ROLL.OPENED"}}: {{opened}}
</div>
{{/if}}
@@ -23,14 +23,14 @@
</div>
</div>
{{#if success}}
<div style="text-align: center; width: 100%; font-weight: bold; color: limegreen;">
<h2 style="border: none; text-align: center; width: 100%; font-weight: bold; color: limegreen;">
{{#if excetional}}{{localize "ROLL.EXCEPTIONAL"}}{{/if}} {{localize "ROLL.SUCCESS"}}
</div>
</h2>
{{/if}}
{{#if failure}}
<div style="text-align: center; width: 100%; font-weight: bold; color: darkred;">
<h2 style="border: none; text-align: center; width: 100%; font-weight: bold; color: darkred;">
{{#if excetional}}{{localize "ROLL.EXCEPTIONAL"}}{{/if}} {{localize "ROLL.FAILURE"}}
</div>
</h2>
{{/if}}
</div>
</div>

View File

@@ -25,13 +25,13 @@
<ul class="items">
<ul class="items-list">
{{#each actor.spells as |spell key|}}
<li class="item flexrow" data-item-id="{{spell._id}}">
<div class="item-name">{{spell.name}}</div>
<li class="item-spell flexrow" data-item-id="{{spell._id}}">
<div class="item-name roll-spell-skill rollable" style="margin-top: auto; margin-bottom: auto;">{{spell.name}}</div>
<div class="cost roll-spell-cost rollable">{{spell.data.cost.value}}</div>
<div class="difficulty">{{rollDifficulty spell.data.difficulty.value}}</div>
<div class="item-controls">
<a class="item-control item-edit" data-parent=".item" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" data-parent=".item" title="Delete Item"><i class="fas fa-trash"></i></a>
<a class="item-control item-edit" data-parent=".item-spell" title="Edit Item"><i class="fas fa-edit"></i></a>
<a class="item-control item-delete" data-parent=".item-spell" title="Delete Item"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}

View File

@@ -1,10 +1,12 @@
<div id="{{id}}" class="roll-dialog">
<h1 style="text-align: center;">{{localize skillName}} ({{skillValue}})</h1>
<label>{{localize "ROLL.OPENCLOSE"}}</label>
<input type="button" name="openclosed" min="0" value="{{startopen}}" style="margin-bottom: 10px; min-height: 26px; min-width: 30px;" />
<label name="notopenedorclosed" style="display: inline-block;">&nbsp;</label>
<label name="closed" style="display: none;">{{localize "ROLL.CLOSED"}}</label>
<label name="opened" style="display: none;">{{localize "ROLL.OPENED"}}</label>
<div class="flexrow" style="margin-bottom: 10px;">
<label style="margin: auto;">{{localize "ROLL.OPENCLOSE"}}</label>
<input type="button" name="openclosed" min="0" value="{{startopen}}" style="min-height: 30px; min-width: 45px;" />
<label name="notopenedorclosed" style="margin: auto; display: inline-block;">&nbsp;</label>
<label name="closed" style="margin: auto; display: none; text-align: center;">{{localize "ROLL.CLOSED"}}</label>
<label name="opened" style="margin: auto; display: none; text-align: center;">{{localize "ROLL.OPENED"}}</label>
</div>
</div>
<script>