Added delete icon to inventory

This commit is contained in:
WBHarry 2025-11-07 16:43:21 +01:00
parent c96cd2beac
commit a23061a8be
7 changed files with 115 additions and 77 deletions

View file

@ -43,36 +43,40 @@
{{> 'daggerheart.inventory-items'
title='TYPES.Item.weapon'
type='weapon'
actorType='party'
collection=document.itemTypes.weapon
isGlassy=true
canCreate=true
hideResources=true
hideControls=true
hideContextMenu=true
}}
{{> 'daggerheart.inventory-items'
title='TYPES.Item.armor'
type='armor'
actorType='party'
collection=document.itemTypes.armor
isGlassy=true
canCreate=true
hideResources=true
hideControls=true
hideContextMenu=true
}}
{{> 'daggerheart.inventory-items'
title='TYPES.Item.consumable'
type='consumable'
actorType='party'
collection=document.itemTypes.consumable
isGlassy=true
canCreate=true
hideControls=true
hideContextMenu=true
}}
{{> 'daggerheart.inventory-items'
title='TYPES.Item.loot'
type='loot'
actorType='party'
collection=document.itemTypes.loot
isGlassy=true
canCreate=true
hideControls=true
hideContextMenu=true
}}
</div>
</section>

View file

@ -10,6 +10,7 @@ Parameters:
- isGlassy {boolean} : If true, applies the 'glassy' class to the fieldset.
- cardView {boolean} : If true and type is 'domainCard', renders using domain card layout.
- isActor {boolean} : Passed through to inventory-item partials.
- actorType {boolean} : The actor type of the parent actor
- canCreate {boolean} : If true, show createDoc anchor on legend
- inVault {boolean} : If true, the domainCard is created with inVault=true
- disabled {boolean}: If true, the ActiveEffect is created with disabled=true;
@ -17,6 +18,7 @@ Parameters:
- showLabels {boolean} : If true, show label-tags else show simple tags.
- hideTooltip {boolean} : If true, disables the tooltip on the item image.
- hideControls {boolean} : If true, hides the controls inside inventory-item partials.
- simpleDelete {boolean} : if true, uses only a delete button for controls.
- hideDescription {boolean} : If true, hides the item's description.
- hideResources {boolean} : If true, hides the item's resources.
- showActions {boolean} : If true show feature's actions.
@ -54,6 +56,7 @@ Parameters:
{{> 'daggerheart.inventory-item'
item=item
type=../type
actorType=../actorType
hideControls=../hideControls
hideContextMenu=../hideContextMenu
isActor=../isActor

View file

@ -4,6 +4,7 @@
Parameters:
- type {string} : The type of items in the list
- isActor {boolean} : Passed through to inventory-item partials.
- actorType {boolean} : The actor type of the parent actor
- categoryAdversary {string} : Category adversary id.
- noExtensible {boolean} : If true, the inventory-item-content would be collapsable/extendible else it always be showed
- hideLabels {boolean} : If true, hide label-tags else show label-tags.
@ -95,17 +96,24 @@ Parameters:
</a>
{{/if}}
{{else}}
{{#if (eq type 'weapon')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.equipped 'unequip' 'equip' }}">
<i class="fa-solid fa-hands"></i>
</a>
{{else if (eq type 'armor')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.equipped 'unequip' 'equip' }}">
<i class="fa-solid fa-shield"></i>
</a>
{{else if (eq type 'domainCard')}}
{{#unless (eq actorType 'party')}}
{{#if (eq type 'weapon')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.equipped 'unequip' 'equip' }}">
<i class="fa-solid fa-hands"></i>
</a>
{{else if (eq type 'armor')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.equipped 'unequip' 'equip' }}">
<i class="fa-solid fa-shield"></i>
</a>
{{/if}}
{{else}}
<a data-action="deleteItem" data-tooltip="DAGGERHEART.UI.Tooltip.deleteItem">
<i class="fa-solid fa-trash"></i>
</a>
{{/unless}}
{{#if (eq type 'domainCard')}}
<a data-action="toggleVault"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.inVault 'sendToLoadout' 'sendToVault' }}">
<i class="fa-solid {{ifThen item.system.inVault 'fa-arrow-up' 'fa-arrow-down'}}"></i>
@ -116,7 +124,7 @@ Parameters:
<i class="{{ifThen item.disabled 'fa-solid fa-toggle-off' 'fa-solid fa-toggle-on'}}"></i>
</a>
{{/if}}
{{#if (hasProperty item "toChat")}}
{{#if (and (hasProperty item "toChat") (not (eq actorType 'party')))}}
<a data-action="toChat" data-tooltip="DAGGERHEART.UI.Tooltip.sendToChat">
<i class="fa-regular fa-message"></i>
</a>