This commit is contained in:
AlecM33
2022-06-11 20:00:58 -04:00
parent dc22ebd309
commit 2fcbb26fee
2 changed files with 6 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
import { globals } from '../config/globals.js';
import { HTMLFragments } from './HTMLFragments.js';
import {toast} from "./Toast";
import { toast } from './Toast';
export class DeckStateManager {
constructor () {
@@ -40,7 +40,7 @@ export class DeckStateManager {
);
}
getQuantityOfRole(role) {
getQuantityOfRole (role) {
return this.deck.find(
(card) => card.role.toLowerCase().trim() === role.toLowerCase().trim()
)?.quantity;
@@ -88,8 +88,8 @@ export class DeckStateManager {
if (e.type === 'click' || e.code === 'Enter') {
e.preventDefault();
toast(
`<span class='toast-minus-one'>-1</span>`
+ sortedDeck[i].role + ' (<span class="toast-minus-role-quantity">' + (sortedDeck[i].quantity - 1).toString() + '</span>)',
'<span class=\'toast-minus-one\'>-1</span>' +
sortedDeck[i].role + ' (<span class="toast-minus-role-quantity">' + (sortedDeck[i].quantity - 1).toString() + '</span>)',
'neutral',
true,
true,

View File

@@ -200,8 +200,8 @@ export class RoleBox {
this.deckManager.addCopyOfCard(name);
}
toast(
'<span class="toast-plus-one">+1 </span>'
+ name + ' (<span class="toast-plus-role-quantity">' + this.deckManager.getQuantityOfRole(name) + '</span>)',
'<span class="toast-plus-one">+1 </span>' +
name + ' (<span class="toast-plus-role-quantity">' + this.deckManager.getQuantityOfRole(name) + '</span>)',
'neutral',
true,
true,