Review Inventory (#55)

* Weapons and Armor are now stored like any other item on the PC. Added equip/unequip logic.

* Changed so that equip attempts always go through and the neccessary weapons are unequipped to fascilitate it

* Fixed drag equip and extracted unequipBeforeEquip logic
This commit is contained in:
WBHarry 2025-05-26 15:43:04 +02:00 committed by GitHub
parent d36520438a
commit cf51153432
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 106 additions and 143 deletions

View file

@ -20,37 +20,29 @@
<h2 class="weapons-label-row">
{{localize "DAGGERHEART.Sheets.PC.Weapons.PrimaryTitle"}}
{{#if weapons.primary}}
<div data-action="viewObject" data-value="{{weapons.primary.uuid}}" class="active-item-label-chip">
<img src="{{weapons.primary.img}}" />
<button data-action="removeActiveItem" data-item="{{weapons.primary.uuid}}"><i class="fa-solid fa-x"></i></button>
</div>
<img class="damage-roll" data-action="attackRoll" data-weapon="{{weapons.primary.uuid}}" src="icons/svg/d12-grey.svg" />
{{/if}}
</h2>
<div class="flexrow">
<input value="{{weapons.primary.name}}" type="text" />
<input value="{{localize weapons.primary.trait}}" type="text" />
<input value="{{localize weapons.primary.range.name}}" type="text" />
<input value="{{localize weapons.primary.range.label}}" type="text" />
<input value="{{weapons.primary.damage.value}} {{#if weapons.primary}}({{localize weapons.primary.damage.type.abbreviation}}){{/if}}" type="text" />
</div>
<input value="{{localize weapons.primary.feature.name}} {{#if weapons.primary.feature}}({{localize weapons.primary.feature.description}}){{/if}}" type="text" />
<input value="{{localize weapons.primary.feature.label}} {{#if weapons.primary.feature}}({{localize weapons.primary.feature.description}}){{/if}}" type="text" />
</div>
<div class="active-item-container">
<h2 class="weapons-label-row">
{{localize "DAGGERHEART.Sheets.PC.Weapons.SecondaryTitle"}}
{{#if weapons.secondary}}
<div data-action="viewObject" data-value="{{weapons.secondary.uuid}}" class="active-item-label-chip">
<img src="{{weapons.secondary.img}}" />
<button data-action="removeActiveItem" data-item="{{weapons.secondary.uuid}}"><i class="fa-solid fa-x"></i></button>
</div>
<img class="damage-roll" data-action="damageRoll" data-value="{{weapons.secondary.damage.value}}" src="icons/svg/d12-grey.svg" />
{{/if}}
</h2>
<div class="flexrow">
<input value="{{weapons.secondary.name}}" type="text" />
<input value="{{localize weapons.secondary.trait}}" type="text" />
<input value="{{localize weapons.secondary.range.name}}" type="text" />
<input value="{{weapons.secondary.damage.value}} {{#if weapons.secondary}}({{localize weapons.secondary.damage.type.abbreviation}}){{/if}}" type="text" />
<input value="{{localize weapons.secondary.range.label}}" type="text" />
<input value="{{weapons.secondary.damage.label}} {{#if weapons.secondary}}({{localize weapons.secondary.damage.type.abbreviation}}){{/if}}" type="text" />
</div>
<input value="{{localize weapons.secondary.feature.name}} {{#if weapons.secondary.feature}}({{localize weapons.secondary.feature.description}}){{/if}}" style="text-overflow: ellipsis;" type="text" />
</div>