[Feature] Updates to inventory icons, context menus, action use, and observer visibility (#1814)

* Update inventory controls and permissions filtering

* Also disable prosemirror editors

* Address context menu deprecation warnings

* Fix context menu detection for actions

* Refine logic for use action when hovering over item icon
This commit is contained in:
Carlos Fernandez 2026-04-20 09:30:43 -04:00 committed by GitHub
parent f2ec5ef458
commit f850cbda76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 222 additions and 215 deletions

View file

@ -7,7 +7,7 @@
type='effect'
isGlassy=true
collection=effects.actives
canCreate=true
canCreate=@root.editable
hideResources=true
}}
@ -16,7 +16,7 @@
type='effect'
isGlassy=true
collection=effects.inactives
canCreate=true
canCreate=@root.editable
hideResources=true
disabled=true
}}

View file

@ -8,8 +8,8 @@
type='feature'
actorType='character'
collection=category.values
canCreate=true
showActions=true
canCreate=@root.editable
showActions=@root.editable
}}
{{else if category.values}}
{{> 'daggerheart.inventory-items'
@ -18,7 +18,7 @@
actorType='character'
collection=category.values
canCreate=false
showActions=true
showActions=@root.editable
}}
{{/if}}

View file

@ -4,22 +4,24 @@
<h1 class="actor-name input" contenteditable="plaintext-only" data-property="name" placeholder="{{localize "DAGGERHEART.GENERAL.actorName"}}">{{source.name}}</h1>
<div class='level-div'>
<h3 class='label'>
{{#if document.system.needsCharacterSetup}}
<button
type="button"
class="level-button glow"
data-action="levelManagement"
>
{{localize "DAGGERHEART.APPLICATIONS.CharacterCreation.buttonTitle"}}
</button>
{{else if document.system.levelData.canLevelUp}}
<button
type="button"
class="level-button glow" data-tooltip="{{localize "DAGGERHEART.ACTORS.Character.levelUp"}}"
data-action="levelManagement"
>
<i class="fa-solid fa-angles-up"></i>
</button>
{{#if @root.editable}}
{{#if document.system.needsCharacterSetup}}
<button
type="button"
class="level-button glow"
data-action="levelManagement"
>
{{localize "DAGGERHEART.APPLICATIONS.CharacterCreation.buttonTitle"}}
</button>
{{else if document.system.levelData.canLevelUp}}
<button
type="button"
class="level-button glow" data-tooltip="{{localize "DAGGERHEART.ACTORS.Character.levelUp"}}"
data-action="levelManagement"
>
<i class="fa-solid fa-angles-up"></i>
</button>
{{/if}}
{{/if}}
{{#unless document.system.needsCharacterSetup}}
{{localize 'DAGGERHEART.GENERAL.level'}}
@ -110,12 +112,14 @@
<i class="fa-solid fa-fw fa-users"></i>
</button>
{{/if}}
<button type="button" data-action="useDowntime" data-type="shortRest" data-tooltip="DAGGERHEART.APPLICATIONS.Downtime.shortRest.title">
<i class="fa-solid fa-fw fa-utensils"></i>
</button>
<button type="button" data-action="useDowntime" data-type="longRest" data-tooltip="DAGGERHEART.APPLICATIONS.Downtime.longRest.title">
<i class="fa-solid fa-fw fa-bed"></i>
</button>
{{#if @root.editable}}
<button type="button" data-action="useDowntime" data-type="shortRest" data-tooltip="DAGGERHEART.APPLICATIONS.Downtime.shortRest.title">
<i class="fa-solid fa-fw fa-utensils"></i>
</button>
<button type="button" data-action="useDowntime" data-type="longRest" data-tooltip="DAGGERHEART.APPLICATIONS.Downtime.longRest.title">
<i class="fa-solid fa-fw fa-bed"></i>
</button>
{{/if}}
</div>
</div>

View file

@ -22,7 +22,7 @@
type='weapon'
collection=@root.inventory.weapons
isGlassy=true
canCreate=true
canCreate=@root.editable
hideResources=true
}}
{{> 'daggerheart.inventory-items'
@ -30,7 +30,7 @@
type='armor'
collection=@root.inventory.armor
isGlassy=true
canCreate=true
canCreate=@root.editable
hideResources=true
}}
{{> 'daggerheart.inventory-items'
@ -38,7 +38,7 @@
type='consumable'
collection=@root.inventory.consumables
isGlassy=true
canCreate=true
canCreate=@root.editable
isQuantifiable=true
}}
{{> 'daggerheart.inventory-items'
@ -46,8 +46,8 @@
type='loot'
collection=@root.inventory.loot
isGlassy=true
canCreate=true
showActions=true
canCreate=@root.editable
showActions=@root.editable
isQuantifiable=true
}}
</div>

View file

@ -27,7 +27,7 @@
isGlassy=true
cardView=cardView
collection=document.system.domainCards.loadout
canCreate=true
canCreate=@root.editable
}}
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.Tabs.vault'
@ -35,7 +35,7 @@
isGlassy=true
cardView=cardView
collection=document.system.domainCards.vault
canCreate=true
canCreate=@root.editable
inVault=true
}}
</div>

View file

@ -45,11 +45,11 @@
</a>
{{/times}}
</div>
<a class="slot-label" data-action="toggleArmorMangement">
<a class="slot-label" data-action="toggleArmorMangement" {{disabled (not @root.editable)}}>
<span class="label">{{localize "DAGGERHEART.GENERAL.armorSlots"}}</span>
<div class="slot-value-container">
<span class="value">{{document.system.armorScore.value}} / {{document.system.armorScore.max}}</span>
<i class="fa-solid fa-gear"></i>
{{#if @root.editable}}<i class="fa-solid fa-gear" inert></i>{{/if}}
</div>
</a>
</div>
@ -64,9 +64,9 @@
value='{{document.system.armorScore.value}}'
max='{{document.system.armorScore.max}}'
></progress>
<a class="status-label" data-action="toggleArmorMangement">
<a class="status-label" data-action="toggleArmorMangement" {{disabled (not @root.editable)}}>
<h4>{{localize "DAGGERHEART.GENERAL.armorSlots"}}</h4>
<i class="fa-solid fa-gear"></i>
{{#if @root.editable}}<i class="fa-solid fa-gear" inert></i>{{/if}}
</a>
{{/if}}
</div>