Fixed so party.inventory has the right controls

This commit is contained in:
WBHarry 2025-11-14 22:51:03 +01:00
parent 196ec07e79
commit 71ba5cfb1e
5 changed files with 27 additions and 25 deletions

View file

@ -2,7 +2,7 @@
"id": "daggerheart", "id": "daggerheart",
"title": "Daggerheart", "title": "Daggerheart",
"description": "An unofficial implementation of the Daggerheart system", "description": "An unofficial implementation of the Daggerheart system",
"version": "1.2.1", "version": "1.2.2",
"compatibility": { "compatibility": {
"minimum": "13", "minimum": "13",
"verified": "13.350", "verified": "13.350",

View file

@ -49,7 +49,6 @@
canCreate=true canCreate=true
hideResources=true hideResources=true
hideContextMenu=true hideContextMenu=true
isActor=true
}} }}
{{> 'daggerheart.inventory-items' {{> 'daggerheart.inventory-items'
title='TYPES.Item.armor' title='TYPES.Item.armor'
@ -60,7 +59,6 @@
canCreate=true canCreate=true
hideResources=true hideResources=true
hideContextMenu=true hideContextMenu=true
isActor=true
}} }}
{{> 'daggerheart.inventory-items' {{> 'daggerheart.inventory-items'
title='TYPES.Item.consumable' title='TYPES.Item.consumable'
@ -70,7 +68,6 @@
isGlassy=true isGlassy=true
canCreate=true canCreate=true
hideContextMenu=true hideContextMenu=true
isActor=true
}} }}
{{> 'daggerheart.inventory-items' {{> 'daggerheart.inventory-items'
title='TYPES.Item.loot' title='TYPES.Item.loot'
@ -80,7 +77,6 @@
isGlassy=true isGlassy=true
canCreate=true canCreate=true
hideContextMenu=true hideContextMenu=true
isActor=true
}} }}
</div> </div>
</section> </section>

View file

@ -28,6 +28,7 @@
item=actor item=actor
type='character' type='character'
isActor=true isActor=true
hideContextMenu=true
}} }}
{{/each}} {{/each}}
</ul> </ul>

View file

@ -10,6 +10,7 @@ Parameters:
- isGlassy {boolean} : If true, applies the 'glassy' class to the fieldset. - isGlassy {boolean} : If true, applies the 'glassy' class to the fieldset.
- cardView {boolean} : If true and type is 'domainCard', renders using domain card layout. - cardView {boolean} : If true and type is 'domainCard', renders using domain card layout.
- isActor {boolean} : Passed through to inventory-item partials. - isActor {boolean} : Passed through to inventory-item partials.
- isItem {boolean} : Passed through to inventory-item partials
- actorType {boolean} : The actor type of the parent actor - actorType {boolean} : The actor type of the parent actor
- canCreate {boolean} : If true, show createDoc anchor on legend - canCreate {boolean} : If true, show createDoc anchor on legend
- inVault {boolean} : If true, the domainCard is created with inVault=true - inVault {boolean} : If true, the domainCard is created with inVault=true

View file

@ -4,6 +4,7 @@
Parameters: Parameters:
- type {string} : The type of items in the list - type {string} : The type of items in the list
- isActor {boolean} : Passed through to inventory-item partials. - isActor {boolean} : Passed through to inventory-item partials.
- isItem {boolean} : Passed through to inventory-item partials
- actorType {boolean} : The actor type of the parent actor - actorType {boolean} : The actor type of the parent actor
- categoryAdversary {string} : Category adversary id. - categoryAdversary {string} : Category adversary id.
- noExtensible {boolean} : If true, the inventory-item-content would be collapsable/extendible else it always be showed - noExtensible {boolean} : If true, the inventory-item-content would be collapsable/extendible else it always be showed
@ -18,7 +19,7 @@ Parameters:
<li class="inventory-item" data-item-id="{{item.id}}" {{#if (or (eq type 'action' ) (eq type 'attack' ))}} <li class="inventory-item" data-item-id="{{item.id}}" {{#if (or (eq type 'action' ) (eq type 'attack' ))}}
data-action-id="{{item.id}}" {{/if}} data-item-uuid="{{item.uuid}}" data-type="{{type}}" data-no-compendium-edit="{{noCompendiumEdit}}" draggable="true"> data-action-id="{{item.id}}" {{/if}} data-item-uuid="{{item.uuid}}" data-type="{{type}}" data-no-compendium-edit="{{noCompendiumEdit}}" draggable="true">
<div class="inventory-item-header {{#if (eq actorType 'party')}}padded{{/if}}" {{#unless noExtensible}}data-action="toggleExtended" {{/unless}}> <div class="inventory-item-header {{#if hideContextMenu}}padded{{/if}}" {{#unless noExtensible}}data-action="toggleExtended" {{/unless}}>
{{!-- Image --}} {{!-- Image --}}
<div class="img-portait" data-action='{{ifThen (or (hasProperty item "use") (eq type "attack")) "useItem" (ifThen <div class="img-portait" data-action='{{ifThen (or (hasProperty item "use") (eq type "attack")) "useItem" (ifThen
(hasProperty item "toChat" ) "toChat" "editDoc" ) }}' {{#unless hideTooltip}} {{#if (eq type 'attack' )}} (hasProperty item "toChat" ) "toChat" "editDoc" ) }}' {{#unless hideTooltip}} {{#if (eq type 'attack' )}}
@ -67,7 +68,7 @@ Parameters:
{{!-- Controls --}} {{!-- Controls --}}
{{#unless hideControls}} {{#unless hideControls}}
<div class="controls"> <div class="controls">
{{#if isActor}} {{#if isActor}}
<a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.openActorWorld"> <a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.openActorWorld">
<i class="fa-solid fa-globe"></i> <i class="fa-solid fa-globe"></i>
</a> </a>
@ -81,7 +82,7 @@ Parameters:
<i class='fas fa-trash'></i> <i class='fas fa-trash'></i>
</a> </a>
{{/if}} {{/if}}
{{else}} {{else}}
{{#unless (eq actorType 'party')}} {{#unless (eq actorType 'party')}}
{{#if (eq type 'weapon')}} {{#if (eq type 'weapon')}}
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem" <a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
@ -94,27 +95,30 @@ Parameters:
<i class="fa-solid fa-shield"></i> <i class="fa-solid fa-shield"></i>
</a> </a>
{{/if}} {{/if}}
{{#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>
</a>
{{else if (eq type 'effect')}}
<a data-action="toggleEffect"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.disabled 'enableEffect' 'disableEffect' }}">
<i class="{{ifThen item.disabled 'fa-solid fa-toggle-off' 'fa-solid fa-toggle-on'}}"></i>
</a>
{{/if}}
{{#if (hasProperty item "toChat")}}
<a data-action="toChat" data-tooltip="DAGGERHEART.UI.Tooltip.sendToChat">
<i class="fa-regular fa-message"></i>
</a>
{{/if}}
{{else}} {{else}}
<a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.openActorWorld">
<i class="fa-solid fa-globe"></i>
</a>
<a data-action="deleteItem" data-tooltip="DAGGERHEART.UI.Tooltip.deleteItem"> <a data-action="deleteItem" data-tooltip="DAGGERHEART.UI.Tooltip.deleteItem">
<i class="fa-solid fa-trash"></i> <i class="fa-solid fa-trash"></i>
</a> </a>
{{/unless}} {{/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>
</a>
{{else if (eq type 'effect')}}
<a data-action="toggleEffect"
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.disabled 'enableEffect' 'disableEffect' }}">
<i class="{{ifThen item.disabled 'fa-solid fa-toggle-off' 'fa-solid fa-toggle-on'}}"></i>
</a>
{{/if}}
{{#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>
{{/if}}
{{#unless hideContextMenu}} {{#unless hideContextMenu}}
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions"> <a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
<i class="fa-solid fa-ellipsis-vertical"></i> <i class="fa-solid fa-ellipsis-vertical"></i>
@ -122,7 +126,7 @@ Parameters:
{{/unless}} {{/unless}}
{{/if}} {{/if}}
</div> </div>
{{/unless}} {{/unless}}
</div> </div>
<div class="inventory-item-content{{#unless noExtensible}} extensible{{/unless}}"> <div class="inventory-item-content{{#unless noExtensible}} extensible{{/unless}}">
{{!-- Description --}} {{!-- Description --}}