Make weapons rollable from the character sheet

This commit is contained in:
Johannes Loher 2021-03-04 00:14:16 +01:00
parent c1c0f41743
commit 3d272f2b92
13 changed files with 173 additions and 66 deletions

View file

@ -17,7 +17,8 @@
{{/if}}
{{!-- image --}}
<div class="ds4-item-list__image" style="background-image: url('{{itemData.img}}')" title="{{itemData.name}}"></div>
<div class="ds4-item-list__image{{#if itemData.data.rollable}} ds4-item-list__image--rollable rollable-item{{/if}}"
style="background-image: url('{{itemData.img}}')" title="{{itemData.name}}"></div>
{{!-- amount --}}
{{#if hasQuantity}}

View file

@ -0,0 +1,19 @@
{{!--
!-- Render a simple form with a single select element. It uses the default form classes of Foundry VTT.
!-- @param identifier: The identifier to use as id for the select element. Can be used to query the value later on.
!-- @param label: Text to display as the label for the select element.
!-- @param options: Key-value pairs that describe the options. The keys are used for the value attribute of the
options, the values are used as content.
--}}
<form class="ds4-simple-form">
<div class="form-group">
<label for="{{identifier}}">{{label}}</label>
<div class="form-fields">
<select name="{{identifier}}" id="{{identifier}}">
{{#each options as | value key |}}
<option value="{{key}}">{{value}}</option>
{{/each}}
</select>
</div>
</div>
</form>