Add more sort options to hand sort

Took 14 minutes
This commit is contained in:
RickyRister 2025-11-05 23:34:06 -08:00 committed by Lukas Brübach
parent 6bc2293292
commit 36e68d86be
6 changed files with 76 additions and 14 deletions

View file

@ -111,12 +111,17 @@ void HandZone::reorganizeCards()
update();
}
void HandZone::sortHand()
void HandZone::sortHand(const QList<CardList::SortOption> &options)
{
if (getLogic()->getCards().isEmpty()) {
return;
}
getLogic()->sortCards({CardList::SortByMainType, CardList::SortByManaValue, CardList::SortByColorGrouping});
// Implicitly sort by name at the end so that cards with the same name appear together.
// Also group printings together
static QList defaultOptions = {CardList::SortByName, CardList::SortByPrinting};
getLogic()->sortCards(options + defaultOptions);
reorganizeCards();
}