Johannes Loher
9d7c570553
This also allows to assign a spell to multiple spell groups, which is the case for many spells in the SRD. Additionally, this makes many small improvements and fixes to the provided spell compendium.
100 lines
4.3 KiB
Handlebars
100 lines
4.3 KiB
Handlebars
{{!--
|
|
SPDX-FileCopyrightText: 2021 Johannes Loher
|
|
SPDX-FileCopyrightText: 2021 Gesina Schwalbe
|
|
|
|
SPDX-License-Identifier: MIT
|
|
--}}
|
|
|
|
{{!-- ======================================================================== --}}
|
|
{{!-- INLINE PARTIAL DEFINITIONS --}}
|
|
{{!-- ======================================================================== --}}
|
|
|
|
{{!--
|
|
!-- Base template to display a value with unit.
|
|
!-- @param unitDatum: the object to display; must have a value and a unit attribute
|
|
!-- @param titleKey: The key of the localized title to use.
|
|
!-- @param unitNames: mapping of allowed unitDatum.unit values to localized unit name
|
|
!-- @param unitAbbrs: mapping of allowed unitDatum.unit values to unit abbreviation
|
|
--}}
|
|
{{#*inline "unit"}}
|
|
<div title="{{localize titleKey}} [{{lookup unitNames unitDatum.unit}}]">
|
|
{{#if unitDatum.value }}
|
|
{{unitDatum.value}} {{lookup unitAbbrs unitDatum.unit}}
|
|
{{else}}-{{/if}}
|
|
</div>
|
|
{{/inline}}
|
|
|
|
{{!--
|
|
!-- Two 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.
|
|
--}}
|
|
{{#*inline "temporalUnit"}}
|
|
{{> unit unitNames=config.i18n.temporalUnits unitAbbrs=config.i18n.temporalUnitsAbbr unitDatum=unitDatum
|
|
titleKey=titleKey}}
|
|
{{/inline}}
|
|
|
|
{{#*inline "distanceUnit"}}
|
|
{{> unit unitNames=config.i18n.distanceUnits unitAbbrs=config.i18n.distanceUnitsAbbr unitDatum=unitDatum
|
|
titleKey=titleKey}}
|
|
{{/inline}}
|
|
|
|
|
|
{{!-- ======================================================================== --}}
|
|
|
|
|
|
<div class="ds4-sheet-tab tab spells" data-group="primary" data-tab="spells">
|
|
{{#unless (isEmpty itemsByType.spell)}}
|
|
<ol class="ds4-embedded-document-list ds4-embedded-document-list--spell item-list">
|
|
{{#> systems/ds4/templates/sheets/actor/components/item-list-header.hbs isEquipable=true hideDescription=true
|
|
type='spell'}}
|
|
{{!-- spell type --}}
|
|
<div class="ds4-embedded-document-list__clickable sort-items" data-data-path="data.spellType"
|
|
title="{{localize 'DS4.SortBySpellType'}}">{{localize 'DS4.SpellTypeAbbr'}}</div>
|
|
|
|
{{!-- spell modifier --}}
|
|
<div class="ds4-embedded-document-list__clickable sort-items" data-data-path="data.spellModifier.complex"
|
|
data-data-path2="data.spellModifier.numerical" title="{{localize 'DS4.SortBySpellModifier'}}">{{localize
|
|
'DS4.SpellModifierAbbr'}}</div>
|
|
|
|
{{!-- max. distance --}}
|
|
<div title="{{localize 'DS4.SpellDistance'}}"><i class="fas fa-ruler"></i></div>
|
|
|
|
{{!-- duration --}}
|
|
<div title="{{localize 'DS4.SpellDuration'}}"><i class="far fa-clock"></i></div>
|
|
|
|
{{!-- cooldown duration --}}
|
|
<div title="{{localize 'DS4.CooldownDuration'}}"><i class="fas fa-hourglass-half"></i></div>
|
|
{{/systems/ds4/templates/sheets/actor/components/item-list-header.hbs}}
|
|
|
|
{{#each itemsByType.spell as |itemData id|}}
|
|
{{#> systems/ds4/templates/sheets/actor/components/item-list-entry.hbs itemData=itemData isEquipable=true
|
|
hideDescription=true}}
|
|
{{!-- spell type --}}
|
|
<img class="ds4-embedded-document-list__image"
|
|
src="{{lookup @root/config.icons.spellTypes itemData.data.spellType}}"
|
|
title="{{lookup @root/config.i18n.spellTypes itemData.data.spellType}}" />
|
|
|
|
{{!-- spell modifier --}}
|
|
<div title="{{localize 'DS4.SpellModifier'}}">{{#if (eq itemData.data.spellModifier.complex
|
|
'')}}{{itemData.data.spellModifier.numerical}}{{else}}{{itemData.data.spellModifier.complex}}{{/if}}</div>
|
|
|
|
{{!-- max. distance --}}
|
|
{{> distanceUnit titleKey='DS4.SpellDistance' unitDatum=itemData.data.maxDistance
|
|
config=@root/config}}
|
|
|
|
{{!-- duration --}}
|
|
{{> temporalUnit titleKey='DS4.SpellDuration' unitDatum=itemData.data.duration config=@root/config}}
|
|
|
|
{{!-- cooldown duration --}}
|
|
<div title="{{localize 'DS4.CooldownDuration'}}">{{lookup @root/config.i18n.cooldownDurations
|
|
itemData.data.cooldownDuration}}</div>
|
|
|
|
{{/systems/ds4/templates/sheets/actor/components/item-list-entry.hbs}}
|
|
{{/each}}
|
|
</ol>
|
|
{{/unless}}
|
|
{{> systems/ds4/templates/sheets/shared/components/add-button.hbs title='DS4.UserInteractionAddItemTitle'
|
|
documentType='item' type='spell'}}
|
|
</div>
|