Update to allow for local storage and signify reserve or cantrip magic

This commit is contained in:
William Moore 2023-07-01 12:41:03 -05:00
parent 776669c659
commit b3dbdd3280
4 changed files with 5 additions and 5 deletions

View File

@ -62,7 +62,7 @@ export class Place extends LitElement {
<div @click="${this.addSpell}">
<h3>${this.location}</h3>
<div class="place-spells">
${this.spells.sort(spellSort).map(spell => spell ? html`<dd-spell .spellRemover="${(name: string) => this.removeSpell(name)}" name="${spell.name}" cost=${spell.cost} color="${spell.color}" category="${spell.category}" cantripMagic="${spell.cantripMagic}" reserveMagic="${spell.reserveMagic}" description="${spell.description}"></dd-spell>` : '')}
${this.spells.sort(spellSort).map(spell => spell ? html`<dd-spell .spellRemover="${(name: string) => this.removeSpell(name)}" name="${spell.name}" cost=${spell.cost} color="${spell.color}" category="${spell.category}" ?cantripMagic="${spell.cantripMagic ?? false}" ?reserveMagic="${spell.reserveMagic ?? false}" description="${spell.description}"></dd-spell>` : '')}
</div>
</div>
`;

View File

@ -28,4 +28,4 @@ export const spellSort = (a: Spell, b: Spell) => {
}
return compareValue;
}
};

View File

@ -10,8 +10,8 @@ export class SpellCard extends LitElement {
color: string = '';
category: string = '';
description: string = '';
cantripMagic: boolean | null = false;
reserveMagic: boolean | null = false;
cantripMagic: boolean = false;
reserveMagic: boolean = false;
@property() spellRemover: any = null;
@property() selectSpell: any = null;

View File

@ -280,7 +280,7 @@ export class SpellList extends LitElement {
<h2 style="text-align: center;">Spells</h2>
<input type="text" @keyup="${(event: any) => this.filterText(event)}" />
<div class="spells">
${this.filteredSpells.sort(spellSort).map(spell => html`<dd-spell name="${spell.name}" cost=${spell.cost} color="${spell.color}" category="${spell.category}" cantripMagic="${spell.cantripMagic}" reserveMagic="${spell.reserveMagic}" description="${spell.description}" .selectSpell="${() => this.selectASpell(spell)}"></dd-spell>`)}
${this.filteredSpells.sort(spellSort).map(spell => html`<dd-spell name="${spell.name}" cost=${spell.cost} color="${spell.color}" category="${spell.category}" ?cantripMagic="${spell.cantripMagic ?? false}" ?reserveMagic="${spell.reserveMagic ?? false}" description="${spell.description}" .selectSpell="${() => this.selectASpell(spell)}"></dd-spell>`)}
</div>
`;
}