Add a macro to perform generic checks

This commit is contained in:
Johannes Loher 2021-05-13 21:39:42 +02:00
parent 441e907b8a
commit 24725c15f9
9 changed files with 138 additions and 29 deletions

View file

@ -8,26 +8,26 @@
--}}
<form class="ds4-roll-options">
<div class="form-group">
<label for="check-target-number">{{localize "DS4.RollDialogCheckTargetNumberLabel"}}</label>
<label for="check-target-number">{{localize "DS4.DialogRollOptionsCheckTargetNumberLabel"}}</label>
<input id="check-target-number" data-type="Number" type="number" name="check-target-number"
value="{{checkTargetNumber}}" />
</div>
<div class="form-group">
<label for="gm-modifier">{{localize "DS4.RollDialogGMModifierLabel"}}</label>
<label for="gm-modifier">{{localize "DS4.DialogRollOptionsGMModifierLabel"}}</label>
<input id="gm-modifier" data-type="Number" type="number" name="gm-modifier" value="0" />
</div>
<div class="form-group">
<label for="maximum-coup-result">{{localize "DS4.RollDialogMaximumCoupResultLabel"}}</label>
<label for="maximum-coup-result">{{localize "DS4.DialogRollOptionsMaximumCoupResultLabel"}}</label>
<input id="maximum-coup-result" data-type="Number" type="number" name="maximum-coup-result"
value="{{maximumCoupResult}}" />
</div>
<div class="form-group">
<label for="minimum-fumble-result">{{localize "DS4.RollDialogMinimumFumbleResultLabel"}}</label>
<label for="minimum-fumble-result">{{localize "DS4.DialogRollOptionsMinimumFumbleResultLabel"}}</label>
<input id="minimum-fumble-result" data-type="Number" type="number" name="minimum-fumble-result"
value="{{minimumFumbleResult}}" />
</div>
<div class="form-group">
<label for="roll-mode">{{localize "DS4.RollDialogRollModeLabel"}}</label>
<label for="roll-mode">{{localize "DS4.DialogRollOptionsRollModeLabel"}}</label>
<div class="form-fields">
<select id="roll-mode" name="roll-mode" data-type="String">
{{#select rollMode}}

View file

@ -1,11 +1,13 @@
{{!--
!-- 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
!-- Render a simple form with select elements. It uses the default form classes of Foundry VTT.
!-- @param selects: An array of objects that each contain the following:
!---- identifier: The identifier to use as id for the select element. Can be used to query the value later on.
!---- label: Text to display as the label for the select element.
!---- 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">
{{#each selects}}
<div class="form-group">
<label for="{{identifier}}">{{label}}</label>
<div class="form-fields">
@ -16,4 +18,5 @@ options, the values are used as content.
</select>
</div>
</div>
{{/each}}
</form>