Add Consumable Items (#62)

Changes:
 + add Quantity value for items
 + add plus and minus buttons for list
 + add roll button if item contains formulas
 + decrease quantity by 1 if rolled
This commit is contained in:
2023-12-15 21:34:32 +01:00
committed by GitHub
parent c313d3448c
commit bfa51605bc
4 changed files with 82 additions and 0 deletions
+8
View File
@@ -123,8 +123,10 @@
<thead>
<tr>
<th class="title">{{localize "TYPES.Item.item"}}</th>
<th class="title center">{{localize "midgard5.item-quantity"}}</th>
<th class="title center">{{localize "midgard5.item-value"}}</th>
<th class="title"></th>
<th class="title"></th>
</tr>
</thead>
<tbody>
@@ -137,11 +139,17 @@
<span class="spell-process">{{localize "midgard5.equipped"}}</span>
{{/if}}
</td>
<td>
<i class="fa fa-minus-circle quantity-decrease" style="cursor: pointer"></i>
<span>{{item.quantity}}</span>
<i class="fa fa-plus-circle quantity-increase" style="cursor: pointer"></i>
</td>
<td style="text-align: start">
{{#unless (or (eq item.value 0) (eq item.currency ""))}}
<span class="spell-process">{{item.value}} {{localize (m5concat "midgard5.currency-" item.currency)}}</span>
{{/unless}}
</td>
<td class="fixed-value">{{#if item.rollExist}}<button class="roll-button roll-consumable-item"></button>{{/if}}</td>
<td class="fixed-value"><a class="item-delete" title="Delete Item"><i class="fas fa-trash"></i></a></td>
</tr>
{{/each}}
+10
View File
@@ -19,6 +19,14 @@
</div>
</td>
</tr>
<tr>
<td>
<div class="flexrow">
<span>{{localize "midgard5.item-quantity"}}</span>
<input id="data.quantity" type="number" name="data.quantity" value="{{data.quantity}}">
</div>
</td>
</tr>
<tr>
<td>
<div class="flexrow">
@@ -36,6 +44,8 @@
</td>
</tr>
</table>
{{> "systems/midgard5/templates/sheets/item/rolls.hbs"}}
{{> "systems/midgard5/templates/sheets/partial/mod.hbs" mods=data.mods calc=data.calc}}