Add the pet details (closes #135)
This commit is contained in:
parent
6504e33fad
commit
36976e5123
5 changed files with 107 additions and 3 deletions
|
|
@ -30,6 +30,7 @@ export const partials = [
|
|||
`actors/char-sheet/v2/partials/inventory/items/untyped.v2.pc.hbs`,
|
||||
`actors/char-sheet/v2/partials/inventory/items/aspect.v2.pc.hbs`,
|
||||
`actors/char-sheet/v2/partials/inventory/items/weapon.v2.pc.hbs`,
|
||||
`actors/char-sheet/v2/partials/inventory/items/pet.v2.pc.hbs`,
|
||||
];
|
||||
|
||||
export const preAliasedPartials = {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,13 @@ import { DescribedItemData } from "./DescribedItemData.mjs";
|
|||
export class PetItemData extends DescribedItemData {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return mergeObject(super.defineSchema(), {
|
||||
const parentSchema = super.defineSchema();
|
||||
|
||||
delete parentSchema.quantity;
|
||||
delete parentSchema.quantity_affects_used_capacity;
|
||||
delete parentSchema.usage_cost;
|
||||
|
||||
return mergeObject(parentSchema, {
|
||||
upkeep: new fields.NumberField({ initial: null, nullable: true }),
|
||||
pokeballd: new fields.BooleanField({ initial: true }),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
return stats;
|
||||
};
|
||||
|
||||
_itemTypesHidden = new Set([`pet`, `armour`, `equipment`, `structure`, `service`]);
|
||||
_itemTypesHidden = new Set([`armour`, `equipment`, `structure`, `service`]);
|
||||
toggleItemFilter(filterName) {
|
||||
if (this._itemTypesHidden.has(filterName)) {
|
||||
this._itemTypesHidden.delete(filterName);
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.untyped, .aspect, .weapon {
|
||||
.untyped, .aspect, .weapon, .pet {
|
||||
@include material.elevate(1);
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
<section
|
||||
class="pet collapse"
|
||||
{{dd-expanded meta.expanded item.uuid}}
|
||||
>
|
||||
<div
|
||||
class="collapse__header"
|
||||
data-collapse-id="{{item.uuid}}"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="collapse__toggle equal-padding reduced-padding"
|
||||
data-collapse-id="{{item.uuid}}"
|
||||
tabindex="0"
|
||||
aria-label="{{dd-i18n 'dotdungeon.sheet.actor.v2.toggle-item-information' item}}"
|
||||
>
|
||||
<div aria-hidden="true" class="icon icon--12">
|
||||
{{{ icons.caret-right }}}
|
||||
</div>
|
||||
</button>
|
||||
<h3 class="pet__name">
|
||||
{{item.name}}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="collapse__content">
|
||||
<hr>
|
||||
<div class="pet__content">
|
||||
<div class="pet__field editable">
|
||||
<label for="{{meta.idp}}-{{item.uuid}}-pokeballd">
|
||||
In Jar?
|
||||
</label>
|
||||
<input
|
||||
type="checkbox"
|
||||
{{checked item.system.pokeballd}}
|
||||
id="{{meta.idp}}-{{item.uuid}}-pokeballd"
|
||||
data-embedded-id="{{item.uuid}}"
|
||||
data-embedded-update="system.pokeballd"
|
||||
data-embedded-update-on="change"
|
||||
>
|
||||
</div>
|
||||
<div class="pet__field">
|
||||
<span>Upkeep:</span>
|
||||
<span>
|
||||
{{dd-empty-state item.system.upkeep}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="pet__field">
|
||||
<span>Tier:</span>
|
||||
<span>{{dd-i18n (concat "dotdungeon.rarity." item.system.tier)}}</span>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="{{dd-i18n 'dotdungeon.common.send-to-chat'}}"
|
||||
data-tooltip="{{dd-i18n 'dotdungeon.common.send-to-chat'}}"
|
||||
data-tooltip-direction="RIGHT"
|
||||
class="pet__button--send-to-chat"
|
||||
>
|
||||
<div aria-hidden="true" class="icon icon--20">
|
||||
{{{ icons.chat-bubble }}}
|
||||
</div>
|
||||
</button>
|
||||
<p class="pet__description">
|
||||
{{#if item.system.description}}
|
||||
{{item.system.description}}
|
||||
{{else}}
|
||||
<span class="placeholder">
|
||||
This pet hasn't been described yet...
|
||||
</span>
|
||||
{{/if}}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="{{dd-i18n 'dotdungeon.common.edit'}}"
|
||||
data-tooltip="{{dd-i18n 'dotdungeon.common.edit'}}"
|
||||
data-tooltip-direction="RIGHT"
|
||||
class="pet__button--edit"
|
||||
data-embedded-edit="{{item.uuid}}"
|
||||
>
|
||||
<div aria-hidden="true" class="icon icon--20">
|
||||
{{{ icons.edit }}}
|
||||
</div>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="{{dd-i18n 'dotdungeon.common.delete'}}"
|
||||
data-tooltip="{{dd-i18n 'dotdungeon.common.delete'}}"
|
||||
data-tooltip-direction="RIGHT"
|
||||
class="pet__button--delete"
|
||||
data-embedded-delete
|
||||
data-embedded-id="{{item.uuid}}"
|
||||
>
|
||||
<div aria-hidden="true" class="icon icon--20">
|
||||
{{{ icons.garbage-bin }}}
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Loading…
Add table
Add a link
Reference in a new issue