FEAT: add inventory-fieldset-items-V2 and inventory-item-V2 partials for Actors

This commit is contained in:
Joaquin Pereyra 2025-07-11 17:49:31 -03:00
parent 9ccbfe1b01
commit 634bb3d644
28 changed files with 733 additions and 514 deletions

View file

@ -16,8 +16,8 @@
<span>{{feature.name}}</span>
</div>
<div class="controls">
<a data-action="editDoc" data-type="Item" data-doc-id="{{feature.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.edit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="deleteDoc" data-type="Item" data-doc-id="{{feature.id}}" data-tooltip="{{localize 'CONTROLS.CommonDelete'}}"><i class="fa-solid fa-trash"></i></a>
<a data-action="editDoc" data-item-uuid="{{feature.uuid}}" data-tooltip="{{localize 'DAGGERHEART.CommonEdit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="deleteDoc" data-item-uuid="{{feature.uuid}}" data-tooltip="{{localize 'CONTROLS.CommonDelete'}}"><i class="fa-solid fa-trash"></i></a>
</div>
</li>
{{/each}}

View file

@ -1,30 +1,33 @@
<section
class='tab {{tabs.adversaries.cssClass}} {{tabs.adversaries.id}}'
data-tab='{{tabs.adversaries.id}}'
data-group='{{tabs.adversaries.group}}'
>
<section class='tab {{tabs.adversaries.cssClass}} {{tabs.adversaries.id}}' data-tab='{{tabs.adversaries.id}}'
data-group='{{tabs.adversaries.group}}'>
<button type="button" class="add-action-btn" data-action="addCategory">
New Category
</button>
{{#each document.system.potentialAdversaries as |category id|}}
<fieldset class="category-container" data-potential-adversary="{{id}}">
<legend>{{category.label}}</legend>
<div class="category-name">
<input type="text" name="{{concat "system.potentialAdversaries." @key ".label" }}" value="{{category.label}}" />
<a data-action="removeCategory" data-category-id={{id}} data-tooltip='{{localize "CONTROLS.CommonDelete"}}'>
<i class="fa-solid fa-trash"></i>
</a>
{{#each document.system.potentialAdversaries as |category categoryId|}}
<fieldset class="category-container" data-potential-adversary="{{categoryId}}">
<legend>{{category.label}}</legend>
<div class="category-name">
<input type="text" name="system.potentialAdversaries.{{categoryId}}.label"
value="{{category.label}}" />
<a data-action="removeCategory" data-category-id={{categoryId}} data-tooltip='{{localize "CONTROLS.CommonDelete"}}'>
<i class="fa-solid fa-trash"></i>
</a>
</div>
<div class="adversaries-container">
{{#each category.adversaries as |adversary|}}
<div class="adversary-container">
{{> 'daggerheart.inventory-item'
item=adversary
type='adversary'
isActor=true
categoryAdversary=categoryId
}}
</div>
<div class="adversaries-container">
{{#each category.adversaries as |adversary|}}
<div class="adversary-container">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=adversary type='adversary' isActor=true categoryAdversary=@../key}}
</div>
{{/each}}
</div>
<div class="adversaries-dragger">
Drop Actors here
</div>
</fieldset>
{{/each}}
</div>
<div class="adversaries-dragger">
Drop Actors here
</div>
</fieldset>
{{/each}}
</section>

View file

@ -16,8 +16,8 @@
<span>{{feature.name}}</span>
</div>
<div class="controls">
<a data-action="editDoc" data-type="Item" data-doc-id="{{feature.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.edit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="deleteDoc" data-type="Item" data-doc-id="{{feature.id}}" data-tooltip="{{localize 'CONTROLS.CommonDelete'}}"><i class="fa-solid fa-trash"></i></a>
<a data-action="editDoc" data-doc-uuid="{{feature.uuid}}" data-tooltip="{{localize 'CONTROLS.CommonEdit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="deleteDoc" data-item-uuid="{{feature.uuid}}" data-tooltip="{{localize 'CONTROLS.CommonDelete'}}"><i class="fa-solid fa-trash"></i></a>
</div>
</li>
{{/each}}

View file

@ -1,8 +1,16 @@
<section
class='tab {{tabs.effects.cssClass}} {{tabs.effects.id}}'
data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'
>
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.GENERAL.activeEffects') type='effect'}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.GENERAL.inactiveEffects') type='effect'}}
<section class='tab {{tabs.effects.cssClass}} {{tabs.effects.id}}' data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'>
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.activeEffects'
type='effect'
isGlassy=true
collection=effects.actives
}}
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.inactiveEffects'
type='effect'
isGlassy=true
collection=effects.inactives
}}
</section>

View file

@ -1,9 +1,11 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<section class='tab {{tabs.features.cssClass}} {{tabs.features.id}}' data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'>
<div class="feature-section">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize tabs.features.label) type='feature' values=document.system.features hideControls=true}}
{{> 'daggerheart.inventory-items'
title=tabs.features.label
type='feature'
collection=document.system.features
hideControls=true
}}
</div>
</section>

View file

@ -5,7 +5,6 @@
>
<fieldset class="fit-height">
<legend>{{localize tabs.notes.label}}</legend>
{{log notes}}
{{formInput notes.field value=notes.value enriched=notes.value toggled=true}}
</fieldset>
</section>

View file

@ -1,38 +1,36 @@
<aside class="adversary-sidebar-sheet">
<div class="portrait {{#if (gte source.system.resources.hitPoints.value source.system.resources.hitPoints.maxTotal)}}death-roll{{/if}}">
<div
class="portrait {{#if (gte source.system.resources.hitPoints.value source.system.resources.hitPoints.maxTotal)}}death-roll{{/if}}">
<img src="{{source.img}}" alt="{{source.name}}" data-action='editImage' data-edit="img">
<a class="death-roll-btn" data-tooltip="{{localize "DAGGERHEART.UI.Tooltip.makeDeathMove"}}" data-action="makeDeathMove"><i class="fas fa-skull death-save" ></i></a>
<a class="death-roll-btn" data-tooltip="{{localize " DAGGERHEART.UI.Tooltip.makeDeathMove"}}"
data-action="makeDeathMove"><i class="fas fa-skull death-save"></i></a>
</div>
<div class="info-section">
<div class="resources-section">
<div class="status-bar">
<div class='status-value'>
<p><input class="bar-input" name="system.resources.hitPoints.value" value="{{source.system.resources.hitPoints.value}}" type="number"></p>
<p><input class="bar-input" name="system.resources.hitPoints.value"
value="{{source.system.resources.hitPoints.value}}" type="number"></p>
<p>/</p>
<p class="bar-label">{{source.system.resources.hitPoints.max}}</p>
</div>
<progress
class='progress-bar'
value='{{source.system.resources.hitPoints.value}}'
max='{{source.system.resources.hitPoints.max}}'
></progress>
<progress class='progress-bar' value='{{source.system.resources.hitPoints.value}}'
max='{{source.system.resources.hitPoints.max}}'></progress>
<div class="status-label">
<h4>HP</h4>
</div>
</div>
<div class="status-bar">
<div class='status-value'>
<p><input class="bar-input" name="system.resources.stress.value" value="{{source.system.resources.stress.value}}" type="number"></p>
<p><input class="bar-input" name="system.resources.stress.value"
value="{{source.system.resources.stress.value}}" type="number"></p>
<p>/</p>
<p class="bar-label">{{source.system.resources.stress.max}}</p>
</div>
<progress
class='progress-bar stress-color'
value='{{source.system.resources.stress.value}}'
max='{{source.system.resources.stress.max}}'
></progress>
<progress class='progress-bar stress-color' value='{{source.system.resources.stress.value}}'
max='{{source.system.resources.stress.max}}'></progress>
<div class="status-label">
<h4>Stress</h4>
</div>
@ -40,20 +38,20 @@
</div>
<div class="status-section">
<div class="threshold-section">
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.minor"}}</h4>
<h4 class="threshold-value">{{document.system.damageThresholds.major}}</h4>
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.major"}}</h4>
<h4 class="threshold-value">{{document.system.damageThresholds.severe}}</h4>
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.severe"}}</h4>
</div>
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.minor"}}</h4>
<h4 class="threshold-value">{{document.system.damageThresholds.major}}</h4>
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.major"}}</h4>
<h4 class="threshold-value">{{document.system.damageThresholds.severe}}</h4>
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.severe"}}</h4>
</div>
</div>
<div class="status-section">
<div class="status-number">
<div class='status-value armor-slots'>
{{#if source.system.difficulty}}
<p>{{source.system.difficulty}}</p>
<p>{{source.system.difficulty}}</p>
{{else}}
<p>-</p>
<p>-</p>
{{/if}}
</div>
<div class="status-label">
@ -63,9 +61,9 @@
<div class="status-number">
<div class='status-value armor-slots'>
{{#if source.system.attack.target.amount}}
<p>{{source.system.attack.target.amount}}</p>
<p>{{source.system.attack.target.amount}}</p>
{{else}}
<p>-</p>
<p>-</p>
{{/if}}
</div>
<div class="status-label">
@ -76,31 +74,39 @@
</div>
<div class="attack-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<side-line-div class="invert"></side-line-div>
<h3>Attack</h3>
<side-line-div></side-line-div>
</div>
<ul class="items-sidebar-list">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=source.system.attack type=source.system.attack.systemPath isSidebar=true}}
{{> 'daggerheart.inventory-item'
item=document.system.attack
type='action'
showLabels=true
hideDescription=true
hideTooltip=true
}}
</ul>
</div>
<div class="experience-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<side-line-div class="invert"></side-line-div>
<h3>Experience</h3>
<side-line-div></side-line-div>
</div>
<div class="experience-list">
{{#each source.system.experiences as |experience id|}}
<div class="experience-row">
<div class="experience-value">
+{{experience.total}}
</div>
<span class="experience-name">{{experience.name}}</span>
<div class="controls">
<a data-action="toChat" data-type="experience" data-uuid="{{id}}"><i class="fa-regular fa-message"></i></a>
</div>
<div class="experience-row">
<div class="experience-value">
+{{experience.total}}
</div>
<span class="experience-name">{{experience.name}}</span>
<div class="controls">
<a data-action="sendExpToChat" data-id="{{id}}">
<i class="fa-regular fa-message"></i>
</a>
</div>
</div>
{{/each}}
</div>
</div>

View file

@ -1,8 +1,17 @@
<section
class='tab {{tabs.effects.cssClass}} {{tabs.effects.id}}'
data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'
>
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.GENERAL.activeEffects') type='effect'}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.GENERAL.inactiveEffects') type='effect'}}
<section class='tab {{tabs.effects.cssClass}} {{tabs.effects.id}}' data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'>
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.activeEffects'
type='effect'
isGlassy=true
collection=effects.actives
}}
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.inactiveEffects'
type='effect'
isGlassy=true
collection=effects.inactives
}}
</section>

View file

@ -1,13 +1,17 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<section class='tab {{tabs.features.cssClass}} {{tabs.features.id}}' data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'>
<div class="features-sections">
{{#each document.system.sheetLists}}
{{#if this.values}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=this.title values=this.values}}
{{/if}}
{{#each document.system.sheetLists as |category|}}
{{#if category.values}}
{{> 'daggerheart.inventory-items'
isGlassy=true
title=category.title
type='feature'
collection=category.values
}}
{{/if}}
{{/each}}
</div>
</section>

View file

@ -29,25 +29,25 @@
<div class="character-details">
<div>
{{#if document.system.class.value}}
<span data-action="editDoc" data-type="Item" data-doc-id="{{document.system.class.value.id}}">{{document.system.class.value.name}}</span>
<span data-action="editDoc" data-item-uuid="{{document.system.class.value.uuid}}">{{document.system.class.value.name}}</span>
{{else}}
<span data-action="openPack" data-key="daggerheart.classes">{{localize 'TYPES.Item.class'}}</span>
{{/if}}
<span class="dot">•</span>
{{#if document.system.class.subclass}}
<span data-action="editDoc" data-type="Item" data-doc-id="{{document.system.class.subclass.id}}">{{document.system.class.subclass.name}}</span>
<span data-action="editDoc" data-item-uuid="{{document.system.class.subclass.uuid}}">{{document.system.class.subclass.name}}</span>
{{else}}
<span data-action="openPack" data-key="daggerheart.subclass">{{localize 'TYPES.Item.subclass'}}</span>
{{/if}}
<span class="dot">•</span>
{{#if document.system.community}}
<span data-action="editDoc" data-type="Item" data-doc-id="{{document.system.community.id}}">{{document.system.community.name}}</span>
<span data-action="editDoc" data-item-uuid="{{document.system.community.uuid}}">{{document.system.community.name}}</span>
{{else}}
<span data-action="openPack" data-key="daggerheart.community">{{localize 'TYPES.Item.community'}}</span>
{{/if}}
<span class="dot">•</span>
{{#if document.system.ancestry}}
<span data-action="editDoc" data-type="Item" data-doc-id="{{document.system.ancestry.id}}">{{document.system.ancestry.name}}</span>
<span data-action="editDoc" data-item-uuid="{{document.system.ancestry.uuid}}">{{document.system.ancestry.name}}</span>
{{else}}
<span data-action="openPack" data-key="daggerheart.ancestry">{{localize 'TYPES.Item.ancestry'}}</span>
{{/if}}
@ -56,13 +56,13 @@
{{#if document.system.multiclass.value}}
<div class="multiclass">
{{#if document.system.multiclass.value}}
<span data-action="editDoc" data-type="Item" data-doc-id="{{document.system.multiclass.value.id}}">{{document.system.multiclass.value.name}}</span>
<span data-action="editDoc"data-item-uuid="{{document.system.multiclass.value.uuid}}">{{document.system.multiclass.value.name}}</span>
{{else}}
<span data-action="openPack" data-key="daggerheart.classes">{{localize 'DAGGERHEART.GENERAL.multiclass'}}</span>
{{/if}}
<span class="dot">•</span>
{{#if document.system.multiclass.subclass}}
<span data-action="editDoc" data-type="Item" data-doc-id="{{document.system.multiclass.subclass.id}}">{{document.system.multiclass.subclass.name}}</span>
<span data-action="editDoc" data-item-uuid="{{document.system.multiclass.subclass.uuid}}">{{document.system.multiclass.subclass.name}}</span>
{{else}}
<span data-action="openPack" data-key="daggerheart.subclass">{{localize 'TYPES.Item.subclass'}}</span>
{{/if}}

View file

@ -14,31 +14,47 @@
<i class="fa-solid fa-filter"></i>
</a>
</div>
<div class="items-section">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'TYPES.Item.weapon') type='weapon' isGlassy=true}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'TYPES.Item.armor') type='armor' isGlassy=true}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'TYPES.Item.consumable') type='consumable' isGlassy=true}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'TYPES.Item.miscellaneous') type='miscellaneous' isGlassy=true}}
{{> 'daggerheart.inventory-items' title='TYPES.Item.weapon'
type='weapon'
collection=document.itemTypes.weapon
isGlassy=true}}
{{> 'daggerheart.inventory-items' title='TYPES.Item.armor'
type='armor'
collection=document.itemTypes.armor
isGlassy=true}}
{{> 'daggerheart.inventory-items' title='TYPES.Item.consumable'
type='consumable'
collection=document.itemTypes.consumable
isGlassy=true}}
{{> 'daggerheart.inventory-items' title='TYPES.Item.miscellaneous'
type='miscellaneous'
collection=document.itemTypes.miscellaneous
isGlassy=true}}
</div>
<div class="currency-section">
<div class="currency-section">
<div class="input">
<span>{{localize this.inventory.currency.coins}}</span>
{{formInput systemFields.gold.fields.coins value=source.system.gold.coins enriched=source.system.gold.coins localize=true toggled=true}}
{{formInput systemFields.gold.fields.coins value=source.system.gold.coins enriched=source.system.gold.coins
localize=true toggled=true}}
</div>
<div class="input">
<span>{{localize this.inventory.currency.handfulls}}</span>
{{formInput systemFields.gold.fields.handfulls value=source.system.gold.handfulls enriched=source.system.gold.handfulls localize=true toggled=true}}
{{formInput systemFields.gold.fields.handfulls value=source.system.gold.handfulls
enriched=source.system.gold.handfulls localize=true toggled=true}}
</div>
<div class="input">
<span>{{localize this.inventory.currency.bags}}</span>
{{formInput systemFields.gold.fields.bags value=source.system.gold.bags enriched=source.system.gold.bags localize=true toggled=true}}
{{formInput systemFields.gold.fields.bags value=source.system.gold.bags enriched=source.system.gold.bags
localize=true toggled=true}}
</div>
<div class="input">
<span>{{localize this.inventory.currency.chests}}</span>
{{formInput systemFields.gold.fields.chests value=source.system.gold.chests enriched=source.system.gold.chests localize=true toggled=true}}
{{formInput systemFields.gold.fields.chests value=source.system.gold.chests
enriched=source.system.gold.chests localize=true toggled=true}}
</div>
</div>
</section>

View file

@ -10,28 +10,31 @@
<a class="filter-button">
<i class="fa-solid fa-filter"></i>
</a>
<button type="button" class="btn-toggle-view" data-action="toggleLoadoutView" data-value="{{listView}}">
<span class="{{ifThen listView 'list-active' ''}} list-icon">
<button type="button" class="btn-toggle-view" data-action="toggleLoadoutView" data-value="{{not cardView}}">
<span class="{{ifThen cardView '' 'list-active'}} list-icon">
<i class="fa-solid fa-bars"></i>
</span>
<span class="{{ifThen listView '' 'grid-active'}} grid-icon">
<span class="{{ifThen cardView 'grid-active' ''}} grid-icon">
<i class="fa-solid fa-grip"></i>
</span>
</button>
</div>
<div class="items-section">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs'
title=(localize 'DAGGERHEART.GENERAL.Tabs.loadout')
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.Tabs.loadout'
type='domainCard'
isGlassy=true
cardView=(ifThen listView "list" "card")}}
cardView=cardView
collection=document.system.domainCards.loadout
}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs'
title=(localize 'DAGGERHEART.GENERAL.Tabs.vault')
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.Tabs.vault'
type='domainCard'
isVault=true
isGlassy=true
cardView=(ifThen listView "list" "card")}}
cardView=cardView
collection=document.system.domainCards.vault
}}
</div>
</section>

View file

@ -1,38 +1,35 @@
<aside class="character-sidebar-sheet">
<div class="portrait {{#if isDeath}}death-roll{{/if}}">
<img src="{{document.img}}" alt="{{document.name}}" data-action='editImage' data-edit="img">
<a class="death-roll-btn" data-tooltip="{{localize "DAGGERHEART.UI.Tooltip.makeDeathMove"}}" {{#if isDeath}}data-action="makeDeathMove"{{/if}}><i class="fas fa-skull death-save" ></i></a>
<a class="death-roll-btn" data-tooltip="DAGGERHEART.UI.Tooltip.makeDeathMove" {{#if
isDeath}}data-action="makeDeathMove" {{/if}}><i class="fas fa-skull death-save"></i></a>
</div>
<div class="info-section">
<div class="resources-section">
<div class="status-bar">
<div class='status-value'>
<p><input class="bar-input" name="system.resources.hitPoints.value" value="{{document.system.resources.hitPoints.value}}" type="number"></p>
<p><input class="bar-input" name="system.resources.hitPoints.value"
value="{{document.system.resources.hitPoints.value}}" type="number"></p>
<p>/</p>
<p class="bar-label">{{document.system.resources.hitPoints.maxTotal}}</p>
</div>
<progress
class='progress-bar'
value='{{document.system.resources.hitPoints.value}}'
max='{{document.system.resources.hitPoints.maxTotal}}'
></progress>
<progress class='progress-bar' value='{{document.system.resources.hitPoints.value}}'
max='{{document.system.resources.hitPoints.maxTotal}}'></progress>
<div class="status-label">
<h4>HP</h4>
</div>
</div>
<div class="status-bar">
<div class='status-value'>
<p><input class="bar-input" name="system.resources.stress.value" value="{{document.system.resources.stress.value}}" type="number"></p>
<p><input class="bar-input" name="system.resources.stress.value"
value="{{document.system.resources.stress.value}}" type="number"></p>
<p>/</p>
<p class="bar-label">{{document.system.resources.stress.maxTotal}}</p>
</div>
<progress
class='progress-bar stress-color'
value='{{document.system.resources.stress.value}}'
max='{{document.system.resources.stress.maxTotal}}'
></progress>
<progress class='progress-bar stress-color' value='{{document.system.resources.stress.value}}'
max='{{document.system.resources.stress.maxTotal}}'></progress>
<div class="status-label">
<h4>Stress</h4>
</div>
@ -51,9 +48,9 @@
<div class="status-number">
<div class='status-value armor-slots'>
{{#if document.system.armor.system.marks}}
<p>{{document.system.armor.system.marks.value}}/{{document.system.armorScore}}</p>
<p>{{document.system.armor.system.marks.value}}/{{document.system.armorScore}}</p>
{{else}}
<p>-</p>
<p>-</p>
{{/if}}
</div>
<div class="status-label">
@ -73,51 +70,61 @@
</div>
<div class="equipment-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<side-line-div class="invert"></side-line-div>
<h3>Equipment</h3>
<side-line-div></side-line-div>
</div>
<ul class="items-sidebar-list">
{{#each document.items as |item|}}
{{#if item.system.equipped}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=item type=item.type isSidebar=true}}
{{/if}}
{{#if item.system.equipped}}
{{> 'daggerheart.inventory-item'
item=item
type=item.type
showLabels=true
hideDescription=true
}}
{{/if}}
{{/each}}
</ul>
</div>
<div class="loadout-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<side-line-div class="invert"></side-line-div>
<h3>Loadout</h3>
<side-line-div></side-line-div>
</div>
<ul class="items-sidebar-list">
{{#each document.items as |item|}}
{{#if (eq item.type 'domainCard')}}
{{#unless item.system.inVault}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=item type=item.type isSidebar=true}}
{{/unless}}
{{/if}}
{{#each document.system.domainCards.loadout as |card|}}
{{> 'daggerheart.inventory-item'
item=card
type='domainCard'
showLabels=true
hideDescription=true
}}
{{/each}}
</ul>
</div>
<div class="experience-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<side-line-div class="invert"></side-line-div>
<h3>Experience</h3>
<side-line-div></side-line-div>
</div>
<div class="experience-list">
{{#each document.system.experiences as |experience id|}}
<div class="experience-row">
<div class="experience-value">
+{{experience.total}}
</div>
<input name="{{concat "system.experiences." id ".name"}}" data-experience={{id}} value="{{experience.name}}" type="text" />
<div class="controls">
<a data-action="toChat" data-type="experience" data-uuid="{{id}}"><i class="fa-regular fa-message"></i></a>
</div>
<div class="experience-row">
<div class="experience-value">
+{{experience.total}}
</div>
<input name="system.experiences.{{id}}.name" data-experience={{id}}
value="{{experience.name}}" type="text" />
<div class="controls">
<a data-action="sendExpToChat" data-type="experience" data-id="{{id}}">
<i class="fa-regular fa-message"></i>
</a>
</div>
</div>
{{/each}}
</div>
</div>

View file

@ -1,43 +1,54 @@
<section
class='tab {{tabs.details.cssClass}} {{tabs.details.id}}'
data-tab='{{tabs.details.id}}'
data-group='{{tabs.details.group}}'
>
<section class='tab {{tabs.details.cssClass}} {{tabs.details.id}}' data-tab='{{tabs.details.id}}'
data-group='{{tabs.details.group}}'>
<div class="partner-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<side-line-div class="invert"></side-line-div>
<h3>Partner</h3>
<side-line-div></side-line-div>
</div>
{{#if document.system.partner}}
<ul class="item-list">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=document.system.partner type='actor' isSidebar=true isActor=true noTooltip=true}}
</ul>
<ul class="item-list">
{{> 'daggerheart.inventory-item'
item=document.system.partner
type='companion'
showLabels=true
hideDescription=true
isActor=true
hideTooltip=true
}}
</ul>
{{else}}
<span class="partner-placeholder">{{localize "DAGGERHEART.ACTORS.Companion.noPartner"}}</span>
<span class="partner-placeholder">{{localize "DAGGERHEART.ACTORS.Companion.noPartner"}}</span>
{{/if}}
</div>
<div class="attack-section">
<div class="title">
<side-line-div class="invert"></side-line-div>
<side-line-div class="invert"></side-line-div>
<h3>Attack</h3>
<side-line-div></side-line-div>
</div>
<ul class="item-list">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-item.hbs' item=source.system.attack type=source.system.attack.systemPath isSidebar=true isCompanion=true noTooltip=true}}
{{> 'daggerheart.inventory-item'
item=document.system.attack
type='action'
showLabels=true
hideDescription=true
hideTooltip=true
}}
</ul>
</div>
<div class="experience-list">
{{#each source.system.experiences as |experience id|}}
<div class="experience-row">
<div class="experience-value">
+{{experience.value}}
</div>
<span class="experience-name">{{experience.name}}</span>
<div class="controls">
<a data-action="toChat" data-type="experience" data-uuid="{{id}}"><i class="fa-regular fa-message"></i></a>
</div>
<div class="experience-row">
<div class="experience-value">
+{{experience.value}}
</div>
<span class="experience-name">{{experience.name}}</span>
<div class="controls">
<a data-action="sendExpToChat" data-type="experience" data-id="{{id}}">
<i class="fa-regular fa-message"></i></a>
</div>
</div>
{{/each}}
</div>
</section>

View file

@ -3,6 +3,17 @@
data-tab='{{tabs.effects.id}}'
data-group='{{tabs.effects.group}}'
>
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.GENERAL.activeEffects') type='effect'}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize 'DAGGERHEART.GENERAL.inactiveEffects') type='effect'}}
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.activeEffects'
type='effect'
isGlassy=true
collection=effects.actives
}}
{{> 'daggerheart.inventory-items'
title='DAGGERHEART.GENERAL.inactiveEffects'
type='effect'
isGlassy=true
collection=effects.inactives
}}
</section>

View file

@ -4,6 +4,11 @@
data-group='{{tabs.features.group}}'
>
<div class="feature-section">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize tabs.features.label) type='feature' values=document.system.features hideControls=true }}
{{> 'daggerheart.inventory-items'
title=tabs.features.label
type='feature'
collection=document.system.features
hideControls=true
}}
</div>
</section>

View file

@ -4,8 +4,16 @@
data-group='{{tabs.potentialAdversaries.group}}'
>
<div class="action-section">
{{#each document.system.potentialAdversaries}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=this.label type='adversary' isGlassy=true adversaries=this.adversaries}}
{{#each document.system.potentialAdversaries as |category categoryId|}}
{{> 'daggerheart.inventory-items'
title=category.label
type='adversary'
isGlassy=true
isActor=true
categoryAdversary=categoryId
hideControls=true
collection=category.adversaries
}}
{{/each}}
</div>
</section>

View file

@ -0,0 +1,59 @@
{{!--
Inventory/Domain Card Section
{{> 'daggerheart.inventory-items' }}
Parameters:
- title {string} : Localization key used for the legend.
- collection {array} : Array of items to render.
- type {string} : The type of items in the list:
- 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.
- canCreate {boolean} : If true, show createDoc anchor on legend
- categoryAdversary {string} : Category adversary id.
- 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.
- hideDescription {boolean} : If true, hides the item's description.
--}}
<fieldset class="{{#if isGlassy}}glassy{{/if}}">
<legend>
{{localize title}}
{{#if canCreate}}
<a data-action="createDoc" data-type="{{type}}">
<i class="fa-solid fa-plus icon-button"></i>
</a>
{{/if }}
</legend>
{{#if (and cardView (eq type 'domainCard'))}}
<ul class="card-list">
{{#each collection as |item|}}
{{> 'systems/daggerheart/templates/sheets/global/partials/domain-card-item.hbs'
item=item
type=../type
}}
{{/each}}
</ul>
{{else}}
<ul class="items-list">
{{#each collection as |item|}}
{{> 'daggerheart.inventory-item'
item=item
type=../type
hideControls=../hideControls
isActor=../isActor
categoryAdversary=../categoryAdversary
hideTooltip=../hideTooltip
showLabels=../showLabels
isAction=../isAction
}}
{{/each}}
</ul>
{{/if}}
</fieldset>

View file

@ -0,0 +1,183 @@
{{!--
{{> 'daggerheart.inventory-item' }}
Parameters:
- type {string} : The type of items in the list
- isActor {boolean} : Passed through to inventory-item partials.
- categoryAdversary {string} : Category adversary id.
- 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.
--}}
<li class="inventory-item" {{#if (eq type 'action' ) }}data-action-id="{{item.id}}" {{/if}}
data-item-uuid="{{item.uuid}}">
{{!-- 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 --}}
data-action="{{ifThen (not item.use) (ifThen (not item.toChat) 'editDoc' 'toChat') 'useItem' }}" {{#unless
hideTooltip}}data-tooltip="#item#{{item.uuid}}" {{/unless}} />
{{!-- Name & Tags --}}
<div class="item-label">
{{!-- Item Name --}}
<div class="item-name">{{item.name}}</div>
{{!-- Weapon Block Start --}}
{{#if (eq type 'weapon')}}
{{#if (not hideTags)}}
<div class="item-tags"></div>
{{else if (not hideLabels)}}
<div class="item-labels">
<div class="label">
{{localize (concat 'DAGGERHEART.CONFIG.Range.' item.system.attack.range '.short')}}
<span> - </span>
{{item.system.attack.damage.parts.0.value.dice}}
{{#if item.system.attack.damage.parts.0.value.bonus}} +
{{item.system.attack.damage.parts.0.value.bonus}}
{{/if}}
{{#with (lookup @root.config.GENERAL.damageTypes item.system.attack.damage.parts.0.type)}}
{{#each icon}}<i class="fa-solid {{this}}"></i>{{/each}}
{{/with}}
</div>
</div>
{{/if}}
{{/if}}
{{!-- Weapon Block End --}}
{{!-- Armor Block Start --}}
{{#if (eq type 'armor')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: {{item.system.baseScore}}</div>
<div class="tag">
{{localize "DAGGERHEART.ITEMS.Armor.baseThresholds.base"}}:
{{item.system.baseThresholds.major}} / {{item.system.baseThresholds.severe}}
</div>
</div>
{{else if (not hideLabels)}}
<div class="item-labels">
<div class="label">
{{localize "DAGGERHEART.ITEMS.Armor.baseScore"}}: {{item.system.baseScore}}
</div>
</div>
{{/if}}
{{/if}}
{{!-- Armor Block End --}}
{{!-- Domain Card Block Start --}}
{{#if (eq type 'domainCard')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">{{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}}</div>
<div class="tag">{{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}}</div>
<div class="tag">
<span class="recall-label">{{localize "DAGGERHEART.ITEMS.DomainCard.recallCost"}}: </span>
<span class="recall-value">{{item.system.recallCost}}</span>
</div>
</div>
{{else if (not hideLabels)}}
<div class="item-labels">
<div class="label">
{{localize (concat 'DAGGERHEART.CONFIG.DomainCardTypes.' item.system.type)}} -
{{localize (concat 'DAGGERHEART.GENERAL.Domain.' item.system.domain '.label')}} -
<span class="recall-value">{{item.system.recallCost}}</span>
<i class="fa-solid fa-bolt"></i>
</div>
</div>
{{/if}}
{{/if}}
{{!-- Domain Card Block End --}}
{{!-- Effect Block Start --}}
{{#if (eq type 'effect')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">
{{localize item.parent.system.metadata.label}}: {{item.parent.name}}
</div>
<div class="tag">
{{#if item.duration.duration}}
{{localize 'DAGGERHEART.EFFECTS.Duration.temporary'}}
{{else}}
{{localize 'DAGGERHEART.EFFECTS.Duration.passive'}}
{{/if}}
</div>
{{#each item.statuses as |status|}}
<div class="tag">{{localize (concat 'DAGGERHEART.CONFIG.Condition.' status '.name')}}</div>
{{/each}}
</div>
{{else if (not hideLabels)}}
{{!-- Empty --}}
{{/if}}
{{/if}}
{{!-- Effect Block End --}}
{{!-- Action Block Start --}}
{{#if (eq type 'action')}}
{{#if (not hideTags)}}
<div class="item-tags">
<div class="tag">{{localize (concat 'DAGGERHEART.ACTIONS.TYPES.' item.type '.name')}}</div>
<div class="tag">{{localize (concat 'DAGGERHEART.CONFIG.ActionType.' item.actionType)}}</div>
</div>
{{else if (not hideLabels)}}
{{!-- Empty --}}
{{/if}}
{{/if}}
{{!-- Action Block End --}}
</div>
{{!-- 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}}
{{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')}}
<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>
{{/if}}
{{!-- I had to use the {{not}} helper because otherwise the function is called when rendering --}}
{{#unless (not item.toChat)}}
<a data-action="toChat" data-tooltip="DAGGERHEART.UI.Tooltip.sendToChat">
<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>
{{/if}}
</div>
{{else}}
<span></span>
{{/unless}}
{{!-- Description --}}
{{#unless hideDescription}}
<div class="item-description">
{{{item.system.description}}}
</div>
{{/unless}}
</li>