Fixed deck selection in Deck Editor Menu (now it shows both Classical Decks and Commander Decks using a CMD suffix) and fixed deck selection in Demo Mode (now it filters decks according to game mode as it happens in normal game mode).

This commit is contained in:
Vittorio Alfieri
2021-02-05 11:25:04 +01:00
parent 8c031585cf
commit f1ee227b84
5 changed files with 15 additions and 12 deletions

View File

@@ -15,16 +15,16 @@
// sortByName to do the sorting. This was done since the menu item display is done in insertion order.
vector<DeckMetaData *> GameState::fillDeckMenu(DeckMenu * _menu, const string& path, const string& smallDeckPrefix,
Player * statsPlayer, int maxDecks, GameType type)
Player * statsPlayer, int maxDecks, GameType type, bool showall)
{
vector<DeckMetaData *> deckMetaDataVector = BuildDeckList(path, smallDeckPrefix, statsPlayer, maxDecks, type);
vector<DeckMetaData *> deckMetaDataVector = BuildDeckList(path, smallDeckPrefix, statsPlayer, maxDecks, type, showall);
renderDeckMenu(_menu, deckMetaDataVector);
return deckMetaDataVector;
}
vector<DeckMetaData *> GameState::BuildDeckList(const string& path, const string& smallDeckPrefix, Player * statsPlayer, int maxDecks, GameType type)
vector<DeckMetaData *> GameState::BuildDeckList(const string& path, const string& smallDeckPrefix, Player * statsPlayer, int maxDecks, GameType type, bool showall)
{
vector<DeckMetaData*> retList;
@@ -42,7 +42,7 @@ vector<DeckMetaData *> GameState::BuildDeckList(const string& path, const string
if (meta)
{
found = 1;
if((meta->isCommanderDeck && type != GAME_TYPE_COMMANDER) || (!meta->isCommanderDeck && type == GAME_TYPE_COMMANDER)){
if(!showall && ((meta->isCommanderDeck && type != GAME_TYPE_COMMANDER) || (!meta->isCommanderDeck && type == GAME_TYPE_COMMANDER))){
meta = NULL; // It will show commander decks only in commander mode and it will hide them in other modes.
nbDecks++;
continue;