mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Introduce null checks, add setShortName and collectorNumber to deckList export.
This commit is contained in:
parent
f6c1253e84
commit
e3f3f0a3ce
1 changed files with 21 additions and 1 deletions
|
|
@ -254,6 +254,14 @@ struct FormatDeckListForExport
|
||||||
mainBoardCards += QString::number(card->getNumber());
|
mainBoardCards += QString::number(card->getNumber());
|
||||||
mainBoardCards += "%20";
|
mainBoardCards += "%20";
|
||||||
mainBoardCards += card->getName();
|
mainBoardCards += card->getName();
|
||||||
|
if (!card->getCardSetShortName().isNull()){
|
||||||
|
mainBoardCards += "%20";
|
||||||
|
mainBoardCards += "(" + card->getCardSetShortName() + ")";
|
||||||
|
}
|
||||||
|
if (!card->getCardCollectorNumber().isNull()) {
|
||||||
|
mainBoardCards += "%20";
|
||||||
|
mainBoardCards += card->getCardCollectorNumber();
|
||||||
|
}
|
||||||
mainBoardCards += "%0A";
|
mainBoardCards += "%0A";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -419,7 +427,19 @@ void DeckLoader::saveToStream_DeckZoneCards(QTextStream &out,
|
||||||
out << "SB: ";
|
out << "SB: ";
|
||||||
}
|
}
|
||||||
|
|
||||||
out << card->getNumber() << " " << card->getName() << "\n";
|
if (card->getNumber()) {
|
||||||
|
out << card->getNumber();
|
||||||
|
}
|
||||||
|
if (!card->getName().isNull() && !card->getName().isEmpty()) {
|
||||||
|
out << " " << card->getName();
|
||||||
|
}
|
||||||
|
if (!card->getCardSetShortName().isNull() && !card->getCardSetShortName().isEmpty()) {
|
||||||
|
out << " " << "(" << card->getCardSetShortName() << ")";
|
||||||
|
}
|
||||||
|
if (!card->getCardCollectorNumber().isNull()) {
|
||||||
|
out << " " << card->getCardCollectorNumber();
|
||||||
|
}
|
||||||
|
out << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue