{{!-- TODO: For items list: only show header, if list is not empty --}} {{!-- ======================================================================== --}} {{!-- INLINE PARTIAL DEFINITIONS --}} {{!-- ======================================================================== --}} {{!-- !-- Render a header row for a given data type. !-- It is a flexbox with a child for each column head. !-- An "equipped" heading is rendered except for the case dataType==='equipment'. !-- The partial assumes a variable dataType to be given in the context. !-- If the partial is called with a partial block, the partial block !-- content is inserted before the description heading. !-- @param datType: hand over the dataType to the partial as hash parameter !-- @param partial-block: hand over custom children of the flexbox in the partial block. --}} {{#*inline "itemListHeader" }}
  • {{!-- equipped --}} {{#if (ne dataType 'equipment')}}
    E
    {{/if}} {{!-- image --}}
    {{!-- amount --}}
    #
    {{!-- name --}}
    {{localize 'DS4.ItemName'}}
    {{!-- item type specifics --}} {{> @partial-block }} {{!-- description --}}
    {{localize 'DS4.HeadingDescription'}}
    {{!-- add button --}} {{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
  • {{/inline}} {{!-- !-- Render a list row from a given item. !-- It is a flexbox with a child for each item value of interest. !-- An equipped checkbox is rendered if item.data.data.equipped is defined. !-- The partial assumes a variable item to be given in the context. !-- If the partial is called with a partial block, the partial block !-- content is inserted before the description. !-- @param item: hand over the item to the partial as hash parameter !-- @param partial-block: hand over custom children of the flexbox in the partial block. --}} {{#*inline "itemListEntry"}}
  • {{!-- equipped --}} {{#if (ne item.data.data.equipped undefined)}} {{/if}} {{!-- image --}}
    {{!-- amount --}} {{!-- name --}} {{!-- item type specifics --}} {{> @partial-block}} {{!-- description --}}
    {{{item.data.data.description}}}
    {{!-- control buttons --}} {{> systems/ds4/templates/actor/partials/overview-control-buttons.hbs }}
  • {{/inline}} {{!-- ======================================================================== --}}
    {{!-- WEAPONS --}}

    {{localize 'DS4.ItemTypeWeapon'}}

      {{#> itemListHeader dataType='weapon'}}
      {{localize 'DS4.AttackTypeAbbr'}}
      {{localize 'DS4.WeaponBonusAbbr'}}
      {{localize 'DS4.OpponentDefenseAbbr'}}
      {{/itemListHeader}} {{#each itemsByType.weapon as |item id|}} {{#> itemListEntry item=item}}
      {{ item.data.data.weaponBonus}}
      {{ item.data.data.opponentDefense}}
      {{/itemListEntry}} {{/each}}
    {{!-- ARMOR --}}

    {{localize 'DS4.ItemTypeArmor'}}

      {{#> itemListHeader dataType='armor'}}
      {{localize 'DS4.ArmorMaterialTypeAbbr'}}
      {{localize 'DS4.ArmorTypeAbbr'}}
      {{localize 'DS4.ArmorValueAbbr'}}
      {{/itemListHeader}} {{#each itemsByType.armor as |item id|}} {{#> itemListEntry item=item }}
      {{lookup ../../config.armorMaterialTypesAbbr item.data.data.armorMaterialType}}
      {{lookup ../../config.armorTypesAbbr item.data.data.armorType}}
      {{ item.data.data.armorValue}}
      {{/itemListEntry}} {{/each}}
    {{!-- SHIELD --}}

    {{localize 'DS4.ItemTypeShield'}}

    {{!-- SPECIFIC --}}
      {{#> itemListHeader dataType='shield' }}
      {{localize 'DS4.ArmorValueAbbr'}}
      {{/itemListHeader}} {{#each itemsByType.shield as |item id|}} {{#> itemListEntry item=item }}
      {{item.data.data.armorValue}}
      {{!-- SPECIFIC --}} {{/itemListEntry}} {{/each}}
    {{!-- TRINKET --}}

    {{localize 'DS4.ItemTypeTrinket'}}

      {{#> itemListHeader dataType='trinket'}}
      {{localize 'DS4.StorageLocation'}}
      {{/itemListHeader}} {{#each itemsByType.trinket as |item id|}} {{#> itemListEntry item=item }} {{/itemListEntry}} {{/each}}
    {{!-- EQUIPMENT --}}

    {{localize 'DS4.ItemTypeEquipment'}}

      {{#> itemListHeader dataType='equipment'}}
      {{localize 'DS4.StorageLocation'}}
      {{/itemListHeader}} {{#each itemsByType.equipment as |item id|}} {{#> itemListEntry item=item }} {{/itemListEntry}} {{/each}}