Automatically calculate spell price
This commit is contained in:
parent
2bf3caac99
commit
b9f7588f95
16 changed files with 273 additions and 58 deletions
|
@ -18,7 +18,7 @@
|
|||
{{/inline}}
|
||||
|
||||
{{!--
|
||||
!-- Two templates based on the "unit" template for displaying values with unit.
|
||||
!-- Three templates based on the "unit" template for displaying values with unit.
|
||||
!-- Both accept a `config` object holding the unitNames and unitAbbr instead of
|
||||
!-- directly handing over the latter two.
|
||||
!-- @param titleKey: The key of the localized title to use.
|
||||
|
@ -28,6 +28,11 @@
|
|||
titleKey=titleKey}}
|
||||
{{/inline}}
|
||||
|
||||
{{#*inline "customTemporalUnit"}}
|
||||
{{> unit unitNames=config.i18n.customTemporalUnits unitAbbrs=config.i18n.customTemporalUnitsAbbr unitDatum=unitDatum
|
||||
titleKey=titleKey}}
|
||||
{{/inline}}
|
||||
|
||||
{{#*inline "distanceUnit"}}
|
||||
{{> unit unitNames=config.i18n.distanceUnits unitAbbrs=config.i18n.distanceUnitsAbbr unitDatum=unitDatum
|
||||
titleKey=titleKey}}
|
||||
|
@ -72,7 +77,7 @@ titleKey=titleKey}}
|
|||
config=../../config}}
|
||||
|
||||
{{!-- duration --}}
|
||||
{{> temporalUnit titleKey='DS4.SpellDuration' unitDatum=itemData.data.duration config=../../config}}
|
||||
{{> customTemporalUnit titleKey='DS4.SpellDuration' unitDatum=itemData.data.duration config=../../config}}
|
||||
|
||||
{{!-- cooldown duration --}}
|
||||
{{> temporalUnit titleKey='DS4.SpellCooldownDuration' unitDatum=itemData.data.cooldownDuration
|
||||
|
|
|
@ -12,11 +12,19 @@
|
|||
<select name="data.{{property}}.unit" data-type="String">
|
||||
{{#select (lookup (lookup data property) 'unit')}}
|
||||
{{#if (eq unitType 'temporal')}}
|
||||
{{#each (lookup config.i18n 'temporalUnitsAbbr') as |value key|}}<option value="{{key}}">{{value}}</option>
|
||||
{{#each (lookup config.i18n 'temporalUnitsAbbr') as |value key|}}
|
||||
<option value="{{key}}">{{value}}</option>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
{{#each (lookup config.i18n 'distanceUnitsAbbr') as |value key|}}<option value="{{key}}">{{value}}</option>
|
||||
{{#if (eq unitType 'customTemporal')}}
|
||||
{{#each (lookup config.i18n 'customTemporalUnitsAbbr') as |value key|}}
|
||||
<option value="{{key}}">{{value}}</option>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
{{#each (lookup config.i18n 'distanceUnitsAbbr') as |value key|}}
|
||||
<option value="{{key}}">{{value}}</option>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
</select>
|
||||
|
@ -62,7 +70,7 @@
|
|||
</div>
|
||||
{{> unitDatum data=data property='maxDistance' localizeString='DS4.SpellMaxDistance' unitType='distance' }}
|
||||
{{> unitDatum data=data property='effectRadius' localizeString='DS4.SpellEffectRadius' unitType='distance' }}
|
||||
{{> unitDatum data=data property='duration' localizeString='DS4.SpellDuration' unitType='temporal' }}
|
||||
{{> unitDatum data=data property='duration' localizeString='DS4.SpellDuration' unitType='customTemporal' }}
|
||||
{{> unitDatum data=data property='cooldownDuration' localizeString='DS4.SpellCooldownDuration' unitType='temporal'
|
||||
}}
|
||||
<div class="side-property" title="{{localize 'DS4.SpellMinimumLevelsHealer'}}">
|
||||
|
@ -81,9 +89,8 @@
|
|||
id="data.minimumLevels.sorcerer" value="{{data.minimumLevels.sorcerer}}" />
|
||||
</div>
|
||||
<div class="side-property">
|
||||
<label for="data.scrollPrice">{{localize "DS4.SpellScrollPriceGold"}}</label>
|
||||
<input type="number" min="0" max="9999" step="0.01" data-dtype="Number" name="data.scrollPrice"
|
||||
id="data.scrollPrice" value="{{data.scrollPrice}}" />
|
||||
<label for="data.price">{{localize "DS4.SpellPrice"}}</label>
|
||||
<span name="data.price" id="data.price">{{data.price}}</span>
|
||||
</div>
|
||||
{{/systems/ds4/templates/sheets/item/components/body.hbs}}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue