Pets and misc changes

This commit is contained in:
Oliver-Akins 2024-01-26 21:40:27 -07:00
parent 4a3523d6cf
commit b30aa18a27
15 changed files with 244 additions and 32 deletions

View file

@ -1,18 +1,18 @@
{{#> dotdungeon.panel class="summons" title="dotdungeon.actor.pc.panel.summons"}}
{{#> dotdungeon.panel class="pets" title="dotdungeon.actor.pc.panel.pets"}}
{{#each items.pet as | pet |}}
<details {{dd-expanded ../meta.expanded pet.uuid}}>
<summary data-collapse-id="{{pet.uuid}}">
{{ pet.name }}
{{#if (defined pet.system.upkeep)}}
<span>
{{localize "dotdungeon.actor.summons.upkeep" upkeep=(pet.system.upkeep)}}
{{localize "dotdungeon.actor.pets.upkeep" upkeep=(pet.system.upkeep)}}
</span>
{{/if}}
</summary>
<div class="summon">
<div class="pet">
{{#if pet.system.description}}
<p class="summon_description">
<p class="pet_description">
{{pet.system.description}}
</p>
{{/if}}
@ -23,6 +23,7 @@
>
Edit
</button>
<!--
<button
class="neutral equal-padding"
data-embedded-chat
@ -32,9 +33,10 @@
{{{ ../icons.chat-bubble }}}
</div>
</button>
-->
<button
class="danger equal-padding"
aria-label="{{localize "dotdungeon.actor.pc.summons.aria.delete"}}"
aria-label="{{localize "dotdungeon.actor.pc.pets.aria.delete"}}"
data-embedded-delete
data-embedded-id="{{pet.uuid}}"
>
@ -45,5 +47,20 @@
</div>
</div>
</details>
{{else}}
<p>
You have no pets, add one using the button below or drag one onto your sheet
</p>
{{/each}}
<button
class="confirm"
data-embedded-create="Pet"
>
<div aria-hidden="true" class="icon icon--20">
{{{ icons.create }}}
</div>
<span>
{{localize "dotdungeon.actor.pc.pets.add"}}
</span>
</button>
{{/ dotdungeon.panel}}

View file

@ -35,7 +35,7 @@
{{> dotdungeon.pc.mounts}}
{{> dotdungeon.pc.summons }}
{{> dotdungeon.pc.pets }}
{{> dotdungeon.pc.storage}}

47
templates/items/pet.hbs Normal file
View file

@ -0,0 +1,47 @@
<form autocomplete="off" class="item--pet">
<h2>
<input
type="text"
placeholder="{{localize "dotdungeon.item.pet.name.placeholder"}}"
name="name"
value="{{item.name}}"
aria-label="{{localize "dotdungeon.item.pet.aria.name"}}"
>
</h2>
<label>
{{localize "dotdungeon.item.pet.cost.label"}}
<input
type="number"
name="system.buy"
value="{{system.buy}}"
aria-label="{{localize "dotdungeon.item.pet.aria.cost"}}"
>
</label>
<label>
{{localize "dotdungeon.item.pet.upkeep.label"}}
<input
type="number"
name="system.upkeep"
value="{{system.upkeep}}"
aria-label="{{localize "dotdungeon.item.pet.aria.upkeep"}}"
>
</label>
<label>
{{localize "dotdungeon.item.pet.description"}}
<textarea
name="system.description"
aria-description="{{localize "dotdungeon.aria.pet-description"}}"
>{{system.description}}</textarea>
</label>
{{#if item.isEmbedded}}
<input
type="checkbox"
id="{{meta.idp}}-pokeballd"
name="system.pokeballd"
{{checked system.pokeballd}}
>
<label for="{{meta.idp}}-pokeballd">
{{localize "dotdungeon.item.pet.pokeballd"}}
</label>
{{/if}}
</form>