daggerheart/templates/sheets/global/partials/inventory-item-V2.hbs
2025-12-15 16:03:00 -05:00

178 lines
No EOL
7.7 KiB
Handlebars

{{!--
{{> 'daggerheart.inventory-item' }}
Parameters:
- type {string} : The type of items in the list
- 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
- 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.
- hideTags {boolean} : If true, hide simple-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.
- 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.
--}}
<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">
<div class="inventory-item-header {{#if hideContextMenu}}padded{{/if}}" {{#unless noExtensible}}data-action="toggleExtended" {{/unless}}>
{{!-- Image --}}
<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' )}}
data-tooltip="#attack#{{item.actor.uuid}}" {{else}} data-tooltip="#item#{{item.uuid}}" {{/if}} {{/unless}}>
<img src="{{item.img}}" class="item-img {{#if isActor}}actor-img{{/if}}" />
{{#if (or item.system.actionsList.size item.system.actionsList.length item.actionType)}}
{{#if @root.isNPC}}
<img class="roll-img d20" src="systems/daggerheart/assets/icons/dice/default/d20.svg" alt="d20">
{{else}}
<img class="roll-img duality" src="systems/daggerheart/assets/icons/dice/duality/DualityBW.svg" alt="2d12">
{{/if}}
{{/if}}
</div>
{{!-- Name & Tags --}}
<div class="item-label">
{{!-- Item Name --}}
<span class="item-name">{{localize item.name}} {{#unless (or noExtensible (not item.system.description))}}<span class="expanded-icon"><i class="fa-solid fa-expand"></i></span>{{/unless}}</span>
{{!-- Tags Start --}}
{{#with item}}
{{#if (not ../hideTags)}}
<div class="item-tags">
{{#each this._getTags as |tag|}}
<div class="tag">
{{tag}}
</div>
{{/each}}
{{!-- Feature Form Tag Start --}}
{{#if (eq ../type 'feature')}}
{{#if (or (eq @root.document.type 'adversary') (eq @root.document.type 'environment'))}}
{{#if system.featureForm}}
<div class="tag feature-form">
<span class="recall-value">{{localize (concat "DAGGERHEART.CONFIG.FeatureForm." system.featureForm)}}</span>
</div>
{{/if}}
{{/if}}
{{/if}}
{{!-- Feature Form Tag End --}}
</div>
{{/if}}
{{/with}}
{{!--Tags End --}}
</div>
{{!-- Simple Resource --}}
{{#if (and (not hideResources) (not (eq item.system.resource.type 'diceValue')))}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
{{#if (and (not hideResources) (gte item.system.quantity 0))}}
<div class="item-resource">
<input type="number" class="inventory-item-quantity" value="{{item.system.quantity}}" min="0" />
</div>
{{/if}}
{{!-- Controls --}}
{{#unless hideControls}}
<div class="controls">
{{#if isActor}}
<a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.openActorWorld">
<i class="fa-solid fa-globe"></i>
</a>
{{#if (eq type 'adversary')}}
<a data-action='deleteAdversary' data-category="{{categoryAdversary}}" data-tooltip="CONTROLS.CommonDelete">
<i class='fas fa-trash'></i>
</a>
{{/if}}
{{#if (eq type 'character')}}
<a data-action='deletePartyMember' data-tooltip="CONTROLS.CommonDelete">
<i class='fas fa-trash'></i>
</a>
{{/if}}
{{else}}
{{#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}}
{{#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}}
<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">
<i class="fa-solid fa-trash"></i>
</a>
{{/unless}}
{{#unless hideContextMenu}}
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
<i class="fa-solid fa-ellipsis-vertical"></i>
</a>
{{/unless}}
{{/if}}
</div>
{{/unless}}
</div>
<div class="inventory-item-content{{#unless noExtensible}} extensible{{/unless}}">
{{!-- Description --}}
{{#unless hideDescription}}
<div class="invetory-description"></div>
{{/unless}}
</div>
{{!-- Dice Resource --}}
{{#if (and (not hideResources) (eq item.system.resource.type 'diceValue'))}}
{{> "systems/daggerheart/templates/sheets/global/partials/item-resource.hbs"}}
{{/if}}
{{!-- Actions Buttons --}}
{{#if (and showActions item.system.actions.size)}}
<div class="item-buttons">
{{#each item.system.actions as | action |}}
<div class="item-button">
{{#if (and (eq action.type 'beastform') @root.beastformActive)}}
<button type="button" data-action="cancelBeastform" data-item-uuid="{{action.uuid}}">
{{localize "DAGGERHEART.ACTORS.Character.cancelBeastform"}}
</button>
{{else}}
<button type="button" data-action="useItem" data-item-uuid="{{action.uuid}}">
{{action.name}}
</button>
{{/if}}
{{#if action.uses.max}}
<div class="spacer"></div>
<button type="button" class="action-uses-button" data-action="increaseActionUses" data-item-uuid="{{action.uuid}}">
{{action.remainingUses}}/{{action.uses.max}}
</button>
{{/if}}
</div>
{{/each}}
</div>
{{/if}}
</li>