FEAT: add context menus for all inventory-items

This commit is contained in:
Joaquin Pereyra 2025-07-13 17:11:48 -03:00
parent 633998ed0b
commit 7d67461184
9 changed files with 342 additions and 138 deletions

View file

@ -6,8 +6,7 @@
</h4>
{{#unless hideContrals}}
<div class='controls'>
<a class='effect-control' data-action='editDoc' data-action-path='{{actionPath}}'
data-tooltip="DAGGERHEART.UI.Tooltip.openItemWorld">
<a class='effect-control' data-action='editDoc' data-tooltip="DAGGERHEART.UI.Tooltip.openItemWorld">
<i class="fa-solid fa-globe"></i>
</a>
<a class='effect-control' data-action='deleteFeature' data-item-uuid='{{feature.uuid}}' data-action-path='{{actionPath}}'

View file

@ -12,8 +12,8 @@ Parameters:
- hideDescription {boolean} : If true, hides the item's description.
--}}
<li class="inventory-item" {{#if (eq type 'action' ) }}data-action-id="{{item.id}}" {{/if}}
data-item-uuid="{{item.uuid}}">
<li class="inventory-item" {{#if (eq type 'action' )}}data-action-id="{{item.id}}"{{/if}}
data-item-uuid="{{item.uuid}}" data-type="{{type}}">
{{!-- Image --}}
<img src="{{item.img}}" class="item-img {{#if isActor}}actor-img{{/if}}"
{{!-- I had to use the {{not}} helper because otherwise the function is called when rendering --}}
@ -172,6 +172,11 @@ Parameters:
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-regular fa-lightbulb' 'fa-solid fa-lightbulb'}}"></i>
</a>
{{/if}}
{{!-- I had to use the {{not}} helper because otherwise the function is called when rendering --}}
{{#unless (not item.toChat)}}
@ -179,7 +184,6 @@ Parameters:
<i class="fa-regular fa-message"></i>
</a>
{{/unless}}
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
<i class="fa-solid fa-ellipsis-vertical"></i>
</a>