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
|
|
|
{{/if}}
|
2021-01-23 23:44:49 +01:00
|
|
|
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
|
2021-01-09 01:11:55 +01:00
|
|
|
{{/inline}}
|
|
|
|
|
|
|
|
|
2021-01-02 01:01:41 +01:00
|
|
|
{{!--
|
|
|
|
!-- Render a header row for a given data type.
|
2021-02-21 03:40:54 +01:00
|
|
|
!-- An "equipped" heading is rendered except for the case dataType==='loot'.
|
2021-01-02 01:01:41 +01:00
|
|
|
!-- 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
|
2021-02-24 04:52:32 +01:00
|
|
|
!-- @param partial-block: hand over custom children in the partial block.
|
2021-01-02 01:01:41 +01:00
|
|
|
--}}
|
2021-01-03 00:08:21 +01:00
|
|
|
{{#*inline "itemListHeader" }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<li class="ds4-item-list__row ds4-item-list__row--header">
|
2021-01-18 19:48:07 +01:00
|
|
|
{{!-- equipped --}}
|
2021-02-21 03:40:54 +01:00
|
|
|
{{#if (ne dataType 'loot')}}
|
2021-02-24 04:52:32 +01:00
|
|
|
<div title="{{localize 'DS4.ItemEquipped'}}">{{localize 'DS4.ItemEquippedAbbr'}}</div>
|
2021-01-18 19:48:07 +01:00
|
|
|
{{/if}}
|
|
|
|
{{!-- image --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div></div>
|
2021-01-18 19:48:07 +01:00
|
|
|
{{!-- amount --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div title="{{localize 'DS4.Quantity'}}">#</div>
|
2021-01-18 19:48:07 +01:00
|
|
|
{{!-- name --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div>{{localize 'DS4.ItemName'}}</div>
|
2021-01-18 19:48:07 +01:00
|
|
|
{{!-- item type specifics --}}
|
|
|
|
{{> @partial-block }}
|
|
|
|
{{!-- description --}}
|
2021-02-24 04:52:32 +01:00
|
|
|
<div>{{localize 'DS4.Description'}}</div>
|
2021-01-23 23:44:49 +01:00
|
|
|
{{!-- control buttons placeholder --}}
|
|
|
|
<div></div>
|
2021-01-18 19:48:07 +01:00
|
|
|
</li>
|
2021-01-02 01:01:41 +01:00
|
|
|
{{/inline}}
|
|
|
|
|
|
|
|
{{!--
|
|
|
|
!-- Render a list row from a given item.
|
2021-02-21 18:52:28 +01:00
|
|
|
!-- An equipped checkbox is rendered except for the case item.data.type==='loot'.
|
2021-01-02 01:01:41 +01:00
|
|
|
!-- 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
|
2021-02-24 04:52:32 +01:00
|
|
|
!-- @param partial-block: hand over custom children in the partial block.
|
2021-01-02 01:01:41 +01:00
|
|
|
--}}
|
2021-01-03 00:08:21 +01:00
|
|
|
{{#*inline "itemListEntry"}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<li class="ds4-item-list__row item" data-item-id="{{item._id}}">
|
2021-01-18 19:48:07 +01:00
|
|
|
{{!-- equipped --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
{{#if (ne item.type 'loot')}}
|
|
|
|
<input class="ds4-item-list__editable ds4-item-list__editable--checkbox" type="checkbox" {{checked
|
|
|
|
item.data.equipped}} data-dtype="Boolean" data-property="data.equipped" title="{{localize 'DS4.ItemEquipped'}}">
|
2021-01-18 19:48:07 +01:00
|
|
|
{{/if}}
|
|
|
|
{{!-- image --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div class="ds4-item-list__image" style="background-image: url('{{item.img}}')" title="{{item.name}}"></div>
|
2021-01-18 19:48:07 +01:00
|
|
|
{{!-- amount --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<input class="ds4-item-list__editable" type="number" min="0" step="1" value="{{item.data.quantity}}"
|
2021-01-18 19:48:07 +01:00
|
|
|
data-dtype="Number" data-property="data.quantity" title="{{localize 'DS4.Quantity'}}" />
|
|
|
|
{{!-- name --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<input class="ds4-item-list__editable" type="text" value="{{item.name}}" data-dtype="String" data-property="name"
|
|
|
|
title="{{htmlToPlainText item.data.description}}" />
|
2021-01-18 19:48:07 +01:00
|
|
|
{{!-- item type specifics --}}
|
|
|
|
{{> @partial-block}}
|
|
|
|
{{!-- description --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div class="ds4-item-list__description" title="{{htmlToPlainText item.data.description}}">
|
|
|
|
{{{item.data.description}}}</div>
|
2021-01-18 19:48:07 +01:00
|
|
|
{{!-- 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 --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeWeaponPlural'}}</h4>
|
2021-01-18 19:59:25 +01:00
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.weapon dataType='weapon' }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<ol class="ds4-item-list ds4-item-list--weapon item-list">
|
2021-01-18 19:59:25 +01:00
|
|
|
{{#> itemListHeader dataType='weapon'}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div class="ds4-item-list__image" title="{{localize 'DS4.AttackType'}}">{{localize 'DS4.AttackTypeAbbr'}}</div>
|
|
|
|
<div title="{{localize 'DS4.WeaponBonus'}}">
|
2021-01-18 19:59:25 +01:00
|
|
|
{{localize 'DS4.WeaponBonusAbbr'}}
|
|
|
|
</div>
|
2021-02-25 19:07:25 +01:00
|
|
|
<div title="{{localize 'DS4.OpponentDefense'}}">
|
2021-01-18 19:59:25 +01:00
|
|
|
{{localize 'DS4.OpponentDefenseAbbr'}}
|
|
|
|
</div>
|
|
|
|
{{/itemListHeader}}
|
|
|
|
{{#each itemsByType.weapon as |item id|}}
|
|
|
|
{{#> itemListEntry item=item}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div class="ds4-item-list__image"
|
|
|
|
style="background-image: url('{{lookup ../../config.icons.attackTypes item.data.attackType}}')"
|
|
|
|
title="{{lookup ../../config.i18n.attackTypes item.data.attackType}}">
|
2021-01-18 19:59:25 +01:00
|
|
|
</div>
|
2021-02-25 19:07:25 +01:00
|
|
|
<div>{{ item.data.weaponBonus}}</div>
|
|
|
|
<div>{{ item.data.opponentDefense}}</div>
|
2021-01-18 19:59:25 +01:00
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{/ifHasItemOfType}}
|
|
|
|
|
|
|
|
{{!-- ARMOR --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeArmorPlural'}}</h4>
|
2021-01-18 19:59:25 +01:00
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.armor dataType='armor' }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<ol class="ds4-item-list ds4-item-list--armor item-list">
|
2021-01-18 19:59:25 +01:00
|
|
|
{{#> itemListHeader dataType='armor'}}
|
|
|
|
<div title="{{localize 'DS4.ArmorMaterialType'}}">{{localize 'DS4.ArmorMaterialTypeAbbr'}}</div>
|
|
|
|
<div title="{{localize 'DS4.ArmorType'}}">{{localize 'DS4.ArmorTypeAbbr'}}</div>
|
2021-02-25 19:07:25 +01:00
|
|
|
<div title="{{localize 'DS4.ArmorValue'}}">
|
2021-01-18 19:59:25 +01:00
|
|
|
{{localize 'DS4.ArmorValueAbbr'}}
|
|
|
|
</div>
|
|
|
|
{{/itemListHeader}}
|
|
|
|
{{#each itemsByType.armor as |item id|}}
|
|
|
|
{{#> itemListEntry item=item }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div title="{{lookup ../../config.i18n.armorMaterialTypes item.data.armorMaterialType}}">
|
|
|
|
{{lookup ../../config.i18n.armorMaterialTypesAbbr item.data.armorMaterialType}}
|
2021-01-18 19:59:25 +01:00
|
|
|
</div>
|
2021-02-25 19:07:25 +01:00
|
|
|
<div title="{{lookup ../../config.i18n.armorTypes item.data.armorType}}">
|
|
|
|
{{lookup ../../config.i18n.armorTypesAbbr item.data.armorType}}
|
2021-01-18 19:59:25 +01:00
|
|
|
</div>
|
2021-02-25 19:07:25 +01:00
|
|
|
<div>{{ item.data.armorValue}}</div>
|
2021-01-18 19:59:25 +01:00
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{/ifHasItemOfType}}
|
|
|
|
|
|
|
|
|
|
|
|
{{!-- SHIELD --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeShieldPlural'}}</h4>
|
2021-01-18 19:59:25 +01:00
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.shield dataType='shield' }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<ol class="ds4-item-list ds4-item-list--shield item-list">
|
2021-01-18 19:59:25 +01:00
|
|
|
{{#> itemListHeader dataType='shield' }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div title="{{localize 'DS4.ArmorValue'}}">
|
2021-01-18 19:59:25 +01:00
|
|
|
{{localize 'DS4.ArmorValueAbbr'}}
|
|
|
|
</div>
|
|
|
|
{{/itemListHeader}}
|
|
|
|
{{#each itemsByType.shield as |item id|}}
|
|
|
|
{{#> itemListEntry item=item }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<div>{{item.data.armorValue}}</div>
|
2021-01-18 19:59:25 +01:00
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{/ifHasItemOfType}}
|
|
|
|
|
2021-02-21 03:40:54 +01:00
|
|
|
{{!-- EQUIPMENT --}}
|
2021-02-24 04:52:32 +01:00
|
|
|
|
2021-02-25 19:07:25 +01:00
|
|
|
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeEquipmentPlural'}}</h4>
|
2021-02-21 03:40:54 +01:00
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.equipment dataType='equipment' }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<ol class="ds4-item-list ds4-item-list--equipment item-list">
|
2021-02-21 03:40:54 +01:00
|
|
|
{{#> itemListHeader dataType='equipment'}}
|
2021-02-24 04:52:32 +01:00
|
|
|
<div>{{localize 'DS4.StorageLocation'}}</div>
|
2021-01-18 19:59:25 +01:00
|
|
|
{{/itemListHeader}}
|
2021-02-21 03:40:54 +01:00
|
|
|
{{#each itemsByType.equipment as |item id|}}
|
2021-01-18 19:59:25 +01:00
|
|
|
{{#> itemListEntry item=item }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<input class="ds4-item-list__editable" type="text" value="{{item.data.storageLocation}}" data-dtype="String"
|
2021-01-18 19:59:25 +01:00
|
|
|
data-property="data.storageLocation" title="{{localize 'DS4.StorageLocation'}}">
|
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
|
|
|
{{/ifHasItemOfType}}
|
|
|
|
|
2021-02-21 03:40:54 +01:00
|
|
|
{{!-- LOOT --}}
|
2021-02-25 19:07:25 +01:00
|
|
|
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeLootPlural'}}</h4>
|
2021-02-21 03:40:54 +01:00
|
|
|
{{#> ifHasItemOfType itemsArray=itemsByType.loot dataType='loot' }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<ol class="ds4-item-list ds4-item-list--loot item-list">
|
2021-02-21 03:40:54 +01:00
|
|
|
{{#> itemListHeader dataType='loot'}}
|
2021-02-24 04:52:32 +01:00
|
|
|
<div>{{localize 'DS4.StorageLocation'}}</div>
|
2021-01-18 19:59:25 +01:00
|
|
|
{{/itemListHeader}}
|
2021-02-21 03:40:54 +01:00
|
|
|
{{#each itemsByType.loot as |item id|}}
|
2021-01-18 19:59:25 +01:00
|
|
|
{{#> itemListEntry item=item }}
|
2021-02-25 19:07:25 +01:00
|
|
|
<input class="ds4-item-list__editable" type="text" value="{{item.data.storageLocation}}" data-dtype="String"
|
2021-01-18 19:59:25 +01:00
|
|
|
data-property="data.storageLocation" title="{{localize 'DS4.StorageLocation'}}">
|
|
|
|
{{/itemListEntry}}
|
|
|
|
{{/each}}
|
|
|
|
</ol>
|
2021-02-20 22:41:33 +01:00
|
|
|
{{/ifHasItemOfType}}
|