ds4/src/templates/actor/partials/items-overview.hbs

152 lines
6.7 KiB
Handlebars
Raw Normal View History

{{!-- TODO: Refactor to avoid code duplication with special-creature-abilites-overview and talents-overview --}}
{{!-- ======================================================================== --}}
{{!-- INLINE PARTIAL DEFINITIONS --}}
{{!-- ======================================================================== --}}
{{!--
!-- 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))}}
{{> @partial-block}}
{{/if}}
2021-01-23 23:44:49 +01:00
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
{{/inline}}
{{!-- ======================================================================== --}}
2021-01-18 19:59:25 +01:00
{{!-- WEAPONS --}}
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeWeaponPlural'}}</h4>
2021-01-18 19:59:25 +01:00
{{#> ifHasItemOfType itemsArray=itemsByType.weapon dataType='weapon' }}
<ol class="ds4-item-list ds4-item-list--weapon item-list">
{{#> systems/ds4/templates/actor/partials/item-list-header.hbs isEquipable=true hasQuantity=true}}
{{!-- attack type --}}
<div class="ds4-item-list__image" title="{{localize 'DS4.AttackType'}}">{{localize 'DS4.AttackTypeAbbr'}}</div>
{{!-- weapon bonus --}}
<div title="{{localize 'DS4.WeaponBonus'}}">
2021-01-18 19:59:25 +01:00
{{localize 'DS4.WeaponBonusAbbr'}}
</div>
{{!-- opponent defense --}}
<div title="{{localize 'DS4.OpponentDefense'}}">
2021-01-18 19:59:25 +01:00
{{localize 'DS4.OpponentDefenseAbbr'}}
</div>
{{/systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.weapon as |itemData id|}}
{{#> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData isEquipable=true hasQuantity=true}}
{{!-- attack type --}}
<div class="ds4-item-list__image"
style="background-image: url('{{lookup ../../config.icons.attackTypes itemData.data.attackType}}')"
title="{{lookup ../../config.i18n.attackTypes itemData.data.attackType}}">
2021-01-18 19:59:25 +01:00
</div>
{{!-- weapon bonus --}}
<div>{{ itemData.data.weaponBonus}}</div>
{{!-- opponent defense --}}
<div>{{ itemData.data.opponentDefense}}</div>
{{/systems/ds4/templates/actor/partials/item-list-entry.hbs}}
2021-01-18 19:59:25 +01:00
{{/each}}
</ol>
{{/ifHasItemOfType}}
{{!-- ARMOR --}}
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeArmorPlural'}}</h4>
2021-01-18 19:59:25 +01:00
{{#> ifHasItemOfType itemsArray=itemsByType.armor dataType='armor' }}
<ol class="ds4-item-list ds4-item-list--armor item-list">
{{#> systems/ds4/templates/actor/partials/item-list-header.hbs isEquipable=true hasQuantity=true}}
{{!-- armor material type --}}
2021-01-18 19:59:25 +01:00
<div title="{{localize 'DS4.ArmorMaterialType'}}">{{localize 'DS4.ArmorMaterialTypeAbbr'}}</div>
{{!-- armor type --}}
2021-01-18 19:59:25 +01:00
<div title="{{localize 'DS4.ArmorType'}}">{{localize 'DS4.ArmorTypeAbbr'}}</div>
{{!-- armor value --}}
<div title="{{localize 'DS4.ArmorValue'}}">
2021-01-18 19:59:25 +01:00
{{localize 'DS4.ArmorValueAbbr'}}
</div>
{{/systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.armor as |itemData id|}}
{{#> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData isEquipable=true hasQuantity=true}}
{{!-- armor material type --}}
<div title="{{lookup ../../config.i18n.armorMaterialTypes itemData.data.armorMaterialType}}">
{{lookup ../../config.i18n.armorMaterialTypesAbbr itemData.data.armorMaterialType}}
2021-01-18 19:59:25 +01:00
</div>
{{!-- armor type --}}
<div title="{{lookup ../../config.i18n.armorTypes itemData.dataData.armorType}}">
{{lookup ../../config.i18n.armorTypesAbbr itemData.dataData.armorType}}
2021-01-18 19:59:25 +01:00
</div>
{{!-- armor value --}}
<div>{{ itemData.data.armorValue}}</div>
{{/systems/ds4/templates/actor/partials/item-list-entry.hbs}}
2021-01-18 19:59:25 +01:00
{{/each}}
</ol>
{{/ifHasItemOfType}}
{{!-- SHIELD --}}
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeShieldPlural'}}</h4>
2021-01-18 19:59:25 +01:00
{{#> ifHasItemOfType itemsArray=itemsByType.shield dataType='shield' }}
<ol class="ds4-item-list ds4-item-list--shield item-list">
{{#> systems/ds4/templates/actor/partials/item-list-header.hbs isEquipable=true hasQuantity=true}}
{{!-- armor value --}}
<div title="{{localize 'DS4.ArmorValue'}}">
2021-01-18 19:59:25 +01:00
{{localize 'DS4.ArmorValueAbbr'}}
</div>
{{/systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.shield as |itemData id|}}
{{#> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData isEquipable=true hasQuantity=true}}
{{!-- armor value --}}
<div>{{itemData.data.armorValue}}</div>
{{/systems/ds4/templates/actor/partials/item-list-entry.hbs}}
2021-01-18 19:59:25 +01:00
{{/each}}
</ol>
{{/ifHasItemOfType}}
2021-02-21 03:40:54 +01:00
{{!-- EQUIPMENT --}}
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeEquipmentPlural'}}</h4>
2021-02-21 03:40:54 +01:00
{{#> ifHasItemOfType itemsArray=itemsByType.equipment dataType='equipment' }}
<ol class="ds4-item-list ds4-item-list--equipment item-list">
{{#> systems/ds4/templates/actor/partials/item-list-header.hbs isEquipable=true hasQuantity=true}}
{{!-- storage location --}}
<div>{{localize 'DS4.StorageLocation'}}</div>
{{/systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.equipment as |itemData id|}}
{{#> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData isEquipable=true hasQuantity=true}}
{{!-- storage location --}}
<input class="ds4-item-list__editable item-change" type="text" value="{{itemData.data.storageLocation}}"
data-dtype="String" data-property="data.storageLocation" title="{{localize 'DS4.StorageLocation'}}">
{{/systems/ds4/templates/actor/partials/item-list-entry.hbs}}
2021-01-18 19:59:25 +01:00
{{/each}}
</ol>
{{/ifHasItemOfType}}
2021-02-21 03:40:54 +01:00
{{!-- LOOT --}}
<h4 class="ds4-item-list-title">{{localize 'DS4.ItemTypeLootPlural'}}</h4>
2021-02-21 03:40:54 +01:00
{{#> ifHasItemOfType itemsArray=itemsByType.loot dataType='loot' }}
<ol class="ds4-item-list ds4-item-list--loot item-list">
{{#> systems/ds4/templates/actor/partials/item-list-header.hbs hasQuantity=true}}
{{!-- storage location --}}
<div>{{localize 'DS4.StorageLocation'}}</div>
{{/systems/ds4/templates/actor/partials/item-list-header.hbs}}
{{#each itemsByType.loot as |itemData id|}}
{{#> systems/ds4/templates/actor/partials/item-list-entry.hbs itemData=itemData hasQuantity=true}}
{{!-- storage location --}}
<input class="ds4-item-list__editable item-change" type="text" value="{{itemData.data.storageLocation}}"
data-dtype="String" data-property="data.storageLocation" title="{{localize 'DS4.StorageLocation'}}">
{{/systems/ds4/templates/actor/partials/item-list-entry.hbs}}
2021-01-18 19:59:25 +01:00
{{/each}}
</ol>
{{/ifHasItemOfType}}