2021-01-13 17:20:25 +01:00
|
|
|
{{!-- TODO: Refactor to avoid code duplication with special-creature-abilites-overview and talents-overview --}}
|
2021-01-02 01:01:41 +01:00
|
|
|
|
|
|
|
{{!-- ======================================================================== --}}
|
|
|
|
{{!-- INLINE PARTIAL DEFINITIONS --}}
|
|
|
|
{{!-- ======================================================================== --}}
|
|
|
|
|
|
|
|
|
2021-01-09 01:11:55 +01:00
|
|
|
{{!--
|
|
|
|
!-- Render the given partial block only if the given itemsArray has length > 0,
|
|
|
|
!-- else only an add button.
|
|
|
|
!--
|
|
|
|
!-- @param itemsArray: the array with the items to check the length of
|
|
|
|
!-- @param dataType: the string type of the item
|
|
|
|
--}}
|
|
|
|
{{#*inline "ifHasItemOfType"}}
|
|
|
|
{{#if (and (ne itemsArray undefined) (gt itemsArray.length 0))}}
|
2021-01-18 19:48:07 +01:00
|
|
|
{{> @partial-block}}
|
2021-01-09 01:11:55 +01:00
|
|
|
{{else}}
|
2021-01-18 19:48:07 +01:00
|
|
|
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
|
2021-01-09 01:11:55 +01:00
|
|
|
{{/if}}
|
|
|
|
{{/inline}}
|
|
|
|
|
|
|
|
|
2021-01-02 01:01:41 +01:00
|
|
|
{{!--
|
|
|
|
!-- 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.
|
|
|
|
--}}
|
2021-01-03 00:08:21 +01:00
|
|
|
{{#*inline "itemListHeader" }}
|
2021-01-18 19:48:07 +01:00
|
|
|
<li class="item flexrow item-header">
|
|
|
|
{{!-- equipped --}}
|
|
|
|
{{#if (ne dataType 'equipment')}}
|
|
|
|
<div class="flex05" title="{{localize 'DS4.ItemEquipped'}}">{{localize 'DS4.ItemEquippedAbbr'}}</div>
|
|
|
|
{{/if}}
|
|
|
|
{{!-- image --}}
|
|
|
|
<div class="flex05 item-image"></div>
|
|
|
|
{{!-- amount --}}
|
|
|
|
<div class="flex05 item-num-val" title="{{localize 'DS4.Quantity'}}">#</div>
|
|
|
|
{{!-- name --}}
|
|
|
|
<div class="flex3 item-name">{{localize 'DS4.ItemName'}}</div>
|
|
|
|
{{!-- item type specifics --}}
|
|
|
|
{{> @partial-block }}
|
|
|
|
{{!-- description --}}
|
|
|
|
<div class="flex4">{{localize 'DS4.Description'}}</div>
|
|
|
|
{{!-- add button --}}
|
|
|
|
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
|
|
|
|
</li>
|
2021-01-02 01:01:41 +01:00
|
|
|
{{/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.
|
2021-01-18 19:48:07 +01:00
|
|
|
!-- If the partial is called with a partial block, the partial block
|
2021-01-02 01:01:41 +01:00
|
|
|
!-- 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.
|
|
|
|
--}}
|
2021-01-03 00:08:21 +01:00
|
|
|
{{#*inline "itemListEntry"}}
|
2021-01-18 19:48:07 +01:00
|
|
|
<li class="item flexrow" data-item-id="{{item._id}}">
|
|
|
|
{{!-- equipped --}}
|
|
|
|
{{#if (ne item.data.data.equipped undefined)}}
|
|
|
|
<input class="flex05 item-change" type="checkbox" {{checked item.data.data.equipped}} data-dtype="Boolean"
|
|
|
|
data-property="data.equipped" title="{{localize 'DS4.ItemEquipped'}}">
|
|
|
|
{{/if}}
|
|
|
|
{{!-- image --}}
|
|
|
|
<div class="flex05 item-image">
|
|
|
|
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24" />
|
|
|
|
</div>
|
|
|
|
{{!-- amount --}}
|
|
|
|
<input class="flex05 item-num-val item-change" type="number" min="0" step="1" value="{{item.data.data.quantity}}"
|
|
|
|
data-dtype="Number" data-property="data.quantity" title="{{localize 'DS4.Quantity'}}" />
|
|
|
|
{{!-- name --}}
|
|
|
|
<input class="flex3 item-name item-change" type="text" value="{{item.name}}" data-dtype="String"
|
|
|
|
data-property="name" title="{{localize 'DS4.ItemName'}}" />
|
|
|
|
{{!-- item type specifics --}}
|
|
|
|
{{> @partial-block}}
|
|
|
|
{{!-- description --}}
|
|
|
|
<div class="flex4 item-description">{{{item.data.data.description}}}</div>
|
|
|
|
{{!-- control buttons --}}
|
|
|
|
{{> systems/ds4/templates/actor/partials/overview-control-buttons.hbs }}
|
|
|
|
</li>
|
2021-01-02 01:01:41 +01:00
|
|
|
{{/inline}}
|
|
|
|
|
|
|
|
|
|
|
|
{{!-- ======================================================================== --}}
|
|
|
|
|
2021-01-18 19:59:25 +01:00
|
|
|
{{!-- WEAPONS --}}
|
|
|
|
<h4 class="items-list-title">{{localize 'DS4.ItemTypeWeaponPlural'}}</h4>
|
|
|
|
{{!-- {{#if (and (ne itemsByType.weapon undefined) (gt itemsByType.weapon.length 0)) }} --}}
|
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.weapon dataType='weapon' }}
|
|
|
|
<ol class="items-list">
|
|
|
|
{{#> itemListHeader dataType='weapon'}}
|
|
|
|
<div class="flex05 item-image" title="{{localize 'DS4.AttackType'}}">{{localize 'DS4.AttackTypeAbbr'}}</div>
|
|
|
|
<div class="flex05 item-num-val" title="{{localize 'DS4.WeaponBonus'}}">
|
|
|
|
{{localize 'DS4.WeaponBonusAbbr'}}
|
|
|
|
</div>
|
|
|
|
<div class="flex05 item-num-val" title="{{localize 'DS4.OpponentDefense'}}">
|
|
|
|
{{localize 'DS4.OpponentDefenseAbbr'}}
|
|
|
|
</div>
|
|
|
|
{{/itemListHeader}}
|
|
|
|
{{#each itemsByType.weapon as |item id|}}
|
|
|
|
{{#> itemListEntry item=item}}
|
|
|
|
<div class="flex05 item-image">
|
|
|
|
<img src="{{lookup ../../config.attackTypesIcons item.data.data.attackType}}"
|
2021-01-24 17:47:47 +01:00
|
|
|
title="{{lookup ../../config.i18n.attackTypes item.data.data.attackType}}" width="24" height="24" />
|
2021-01-18 19:59:25 +01:00
|
|
|
</div>
|
|
|
|
<div class="flex05 item-num-val">{{ item.data.data.weaponBonus}}</div>
|
|
|
|
<div class="flex05 item-num-val">{{ item.data.data.opponentDefense}}</div>
|
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{!-- {{else}}
|
|
|
|
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='weapon' }} --}}
|
|
|
|
{{/ifHasItemOfType}}
|
|
|
|
|
|
|
|
{{!-- ARMOR --}}
|
|
|
|
<h4 class="items-list-title">{{localize 'DS4.ItemTypeArmorPlural'}}</h4>
|
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.armor dataType='armor' }}
|
|
|
|
<ol class="items-list">
|
|
|
|
{{#> itemListHeader dataType='armor'}}
|
|
|
|
<div title="{{localize 'DS4.ArmorMaterialType'}}">{{localize 'DS4.ArmorMaterialTypeAbbr'}}</div>
|
|
|
|
<div title="{{localize 'DS4.ArmorType'}}">{{localize 'DS4.ArmorTypeAbbr'}}</div>
|
|
|
|
<div class="flex05 item-num-val" title="{{localize 'DS4.ArmorValue'}}">
|
|
|
|
{{localize 'DS4.ArmorValueAbbr'}}
|
|
|
|
</div>
|
|
|
|
{{/itemListHeader}}
|
|
|
|
{{#each itemsByType.armor as |item id|}}
|
|
|
|
{{#> itemListEntry item=item }}
|
2021-01-24 17:47:47 +01:00
|
|
|
<div title="{{lookup ../../config.i18n.armorMaterialTypes item.data.data.armorMaterialType}}">
|
|
|
|
{{lookup ../../config.i18n.armorMaterialTypesAbbr item.data.data.armorMaterialType}}
|
2021-01-18 19:59:25 +01:00
|
|
|
</div>
|
2021-01-24 17:47:47 +01:00
|
|
|
<div title="{{lookup ../../config.i18n.armorTypes item.data.data.armorType}}">
|
|
|
|
{{lookup ../../config.i18n.armorTypesAbbr item.data.data.armorType}}
|
2021-01-18 19:59:25 +01:00
|
|
|
</div>
|
|
|
|
<div class="flex05 item-num-val">{{ item.data.data.armorValue}}</div>
|
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{/ifHasItemOfType}}
|
|
|
|
|
|
|
|
|
|
|
|
{{!-- SHIELD --}}
|
|
|
|
<h4 class="items-list-title">{{localize 'DS4.ItemTypeShieldPlural'}}</h4> {{!-- SPECIFIC --}}
|
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.shield dataType='shield' }}
|
|
|
|
<ol class="items-list">
|
|
|
|
{{#> itemListHeader dataType='shield' }}
|
|
|
|
<div class="flex05 item-num-val" title="{{localize 'DS4.ArmorValue'}}">
|
|
|
|
{{localize 'DS4.ArmorValueAbbr'}}
|
|
|
|
</div>
|
|
|
|
{{/itemListHeader}}
|
|
|
|
{{#each itemsByType.shield as |item id|}}
|
|
|
|
{{#> itemListEntry item=item }}
|
|
|
|
<div class="flex05 item-num-val">{{item.data.data.armorValue}}</div> {{!-- SPECIFIC --}}
|
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{/ifHasItemOfType}}
|
|
|
|
|
|
|
|
{{!-- TRINKET --}}
|
|
|
|
<h4 class="items-list-title">{{localize 'DS4.ItemTypeTrinketPlural'}}</h4>
|
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.trinket dataType='trinket' }}
|
|
|
|
<ol class="items-list">
|
|
|
|
{{#> itemListHeader dataType='trinket'}}
|
|
|
|
<div class="flex2">{{localize 'DS4.StorageLocation'}}</div>
|
|
|
|
{{/itemListHeader}}
|
|
|
|
{{#each itemsByType.trinket as |item id|}}
|
|
|
|
{{#> itemListEntry item=item }}
|
|
|
|
<input class="flex2 item-change" type="text" value="{{item.data.data.storageLocation}}" data-dtype="String"
|
|
|
|
data-property="data.storageLocation" title="{{localize 'DS4.StorageLocation'}}">
|
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{/ifHasItemOfType}}
|
|
|
|
|
|
|
|
{{!-- EQUIPMENT --}}
|
|
|
|
<h4 class="items-list-title">{{localize 'DS4.ItemTypeEquipmentPlural'}}</h4>
|
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.equipment dataType='equipment' }}
|
|
|
|
<ol class="items-list">
|
|
|
|
{{#> itemListHeader dataType='equipment'}}
|
|
|
|
<div class="flex2">{{localize 'DS4.StorageLocation'}}</div>
|
|
|
|
{{/itemListHeader}}
|
|
|
|
{{#each itemsByType.equipment as |item id|}}
|
|
|
|
{{#> itemListEntry item=item }}
|
|
|
|
<input class="flex2 item-change" type="text" value="{{item.data.data.storageLocation}}" data-dtype="String"
|
|
|
|
data-property="data.storageLocation" title="{{localize 'DS4.StorageLocation'}}">
|
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{/ifHasItemOfType}}
|