change placeholder, sort current deck

This commit is contained in:
AlecM33
2022-03-30 21:58:19 -04:00
parent ecb9c70ec1
commit 2709a22cb3
2 changed files with 8 additions and 2 deletions

View File

@@ -728,7 +728,13 @@ function updateDeckStatus (deckManager) {
if (document.getElementById('deck-list-placeholder')) {
document.getElementById('deck-list-placeholder').remove();
}
for (const card of deckManager.getCurrentDeck()) {
const sortedDeck = deckManager.getCurrentDeck().sort((a, b) => {
if (a.team !== b.team) {
return a.team === globals.ALIGNMENT.GOOD ? 1 : -1;
}
return a.role.localeCompare(b.role);
});
for (const card of sortedDeck) {
if (card.quantity > 0) {
const roleEl = document.createElement('div');
roleEl.classList.add('deck-role');