Fixed drag equip and extracted unequipBeforeEquip logic

This commit is contained in:
WBHarry 2025-05-26 13:03:57 +02:00
parent 9ce77c126a
commit 1099948a9b
6 changed files with 27 additions and 107 deletions

View file

@ -1,41 +0,0 @@
<fieldset class="left-main-container" style="flex: 1; display: flex; flex-direction: column;">
<legend class="legend inventory-legend">
{{localize "DAGGERHEART.Sheets.PC.Inventory.Title"}}
</legend>
<div class="inventory-items">
<div class="inventory-weapon-section-first item-section">
<h2 class="armor-container">
{{localize "DAGGERHEART.Sheets.PC.Inventory.InventoryWeapon"}}
</h2>
<div class="active-item-container">
<div class="flexrow">
<input value="{{weapons.first.name}}" type="text" />
<input value="{{localize weapons.first.trait}}" type="text" />
<input value="{{localize weapons.first.range.name}}" type="text" />
<input value="{{weapons.first.damage.value}} {{#if weapons.first}}({{localize weapons.first.damage.type.abbreviation}}){{/if}}" type="text" />
</div>
<input value="{{localize weapons.first.feature.name}} {{#if weapons.first.feature}}({{localize weapons.first.feature.description}}){{/if}}" type="text" />
</div>
</div>
<div class="inventory-weapon-section-second item-section">
<h2 class="armor-container">
{{localize "DAGGERHEART.Sheets.PC.Inventory.InventoryWeapon"}}
{{#if weapons.second}}
<div data-action="viewObject" data-value="{{weapons.second.uuid}}" class="active-item-label-chip">
<img src="{{weapons.second.img}}" />
<button data-action="removeInventoryWeapon" data-item="{{weapons.second.uuid}}"><i class="fa-solid fa-x"></i></button>
</div>
{{/if}}
</h2>
<div class="active-item-container">
<div class="flexrow">
<input value="{{weapons.second.name}}" type="text" />
<input value="{{localize weapons.second.trait}}" type="text" />
<input value="{{localize weapons.second.range.name}}" type="text" />
<input value="{{weapons.second.damage.value}} {{#if weapons.second}}({{localize weapons.second.damage.type.abbreviation}}){{/if}}" type="text" />
</div>
<input value="{{localize weapons.second.feature.name}} {{#if weapons.second.feature}}({{localize weapons.second.feature.description}}){{/if}}" type="text" />
</div>
</div>
</div>
</fieldset>

View file

@ -90,7 +90,6 @@
{{> "systems/daggerheart/templates/sheets/parts/attributes.hbs" }}
{{> "systems/daggerheart/templates/sheets/parts/weapons.hbs" weapons=document.system.equippedWeapons proficiency=document.system.proficiency.value }}
{{> "systems/daggerheart/templates/sheets/parts/armor.hbs" armor=document.system.armor }}
{{> "systems/daggerheart/templates/sheets/parts/inventory.hbs" weapons=document.system.inventoryWeapons }}
</div>
</div>
</div>