mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
rename field
This commit is contained in:
parent
4f67e69390
commit
f916c97fb7
2 changed files with 10 additions and 10 deletions
|
|
@ -231,7 +231,7 @@ CardInfo::CardInfo(const QString &_name,
|
||||||
int _tableRow,
|
int _tableRow,
|
||||||
bool _upsideDownArt)
|
bool _upsideDownArt)
|
||||||
: name(_name), text(_text), isToken(_isToken), properties(std::move(_properties)), relatedCards(_relatedCards),
|
: name(_name), text(_text), isToken(_isToken), properties(std::move(_properties)), relatedCards(_relatedCards),
|
||||||
reverseRelatedCards(_reverseRelatedCards), sets(std::move(_sets)), cipt(_cipt),
|
reverseRelatedCards(_reverseRelatedCards), setsToPrintings(std::move(_sets)), cipt(_cipt),
|
||||||
landscapeOrientation(_landscapeOrientation), tableRow(_tableRow), upsideDownArt(_upsideDownArt)
|
landscapeOrientation(_landscapeOrientation), tableRow(_tableRow), upsideDownArt(_upsideDownArt)
|
||||||
{
|
{
|
||||||
pixmapCacheKey = QLatin1String("card_") + name;
|
pixmapCacheKey = QLatin1String("card_") + name;
|
||||||
|
|
@ -294,8 +294,8 @@ void CardInfo::addToSet(const CardSetPtr &_set, const PrintingInfo _info)
|
||||||
if (!_set->contains(smartThis)) {
|
if (!_set->contains(smartThis)) {
|
||||||
_set->append(smartThis);
|
_set->append(smartThis);
|
||||||
}
|
}
|
||||||
if (!sets[_set->getShortName()].contains(_info)) {
|
if (!setsToPrintings[_set->getShortName()].contains(_info)) {
|
||||||
sets[_set->getShortName()].append(_info);
|
setsToPrintings[_set->getShortName()].append(_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshCachedSetNames();
|
refreshCachedSetNames();
|
||||||
|
|
@ -316,7 +316,7 @@ void CardInfo::refreshCachedSetNames()
|
||||||
{
|
{
|
||||||
QStringList setList;
|
QStringList setList;
|
||||||
// update the cached list of set names
|
// update the cached list of set names
|
||||||
for (const auto &printings : sets) {
|
for (const auto &printings : setsToPrintings) {
|
||||||
for (const auto &printing : printings) {
|
for (const auto &printing : printings) {
|
||||||
if (printing.getSet()->getEnabled()) {
|
if (printing.getSet()->getEnabled()) {
|
||||||
setList << printing.getSet()->getShortName();
|
setList << printing.getSet()->getShortName();
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ private:
|
||||||
// the cards thare are reverse-related to me
|
// the cards thare are reverse-related to me
|
||||||
QList<CardRelation *> reverseRelatedCardsToMe;
|
QList<CardRelation *> reverseRelatedCardsToMe;
|
||||||
// card sets
|
// card sets
|
||||||
SetToPrintingsMap sets;
|
SetToPrintingsMap setsToPrintings;
|
||||||
// cached set names
|
// cached set names
|
||||||
QString setsNames;
|
QString setsNames;
|
||||||
// positioning properties; used by UI
|
// positioning properties; used by UI
|
||||||
|
|
@ -229,7 +229,7 @@ public:
|
||||||
: QObject(other.parent()), name(other.name), simpleName(other.simpleName), pixmapCacheKey(other.pixmapCacheKey),
|
: QObject(other.parent()), name(other.name), simpleName(other.simpleName), pixmapCacheKey(other.pixmapCacheKey),
|
||||||
text(other.text), isToken(other.isToken), properties(other.properties), relatedCards(other.relatedCards),
|
text(other.text), isToken(other.isToken), properties(other.properties), relatedCards(other.relatedCards),
|
||||||
reverseRelatedCards(other.reverseRelatedCards), reverseRelatedCardsToMe(other.reverseRelatedCardsToMe),
|
reverseRelatedCards(other.reverseRelatedCards), reverseRelatedCardsToMe(other.reverseRelatedCardsToMe),
|
||||||
sets(other.sets), setsNames(other.setsNames), cipt(other.cipt),
|
setsToPrintings(other.setsToPrintings), setsNames(other.setsNames), cipt(other.cipt),
|
||||||
landscapeOrientation(other.landscapeOrientation), tableRow(other.tableRow), upsideDownArt(other.upsideDownArt)
|
landscapeOrientation(other.landscapeOrientation), tableRow(other.tableRow), upsideDownArt(other.upsideDownArt)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -313,7 +313,7 @@ public:
|
||||||
}
|
}
|
||||||
const SetToPrintingsMap &getSets() const
|
const SetToPrintingsMap &getSets() const
|
||||||
{
|
{
|
||||||
return sets;
|
return setsToPrintings;
|
||||||
}
|
}
|
||||||
const QString &getSetsNames() const
|
const QString &getSetsNames() const
|
||||||
{
|
{
|
||||||
|
|
@ -321,17 +321,17 @@ public:
|
||||||
}
|
}
|
||||||
QString getSetProperty(const QString &setName, const QString &propertyName) const
|
QString getSetProperty(const QString &setName, const QString &propertyName) const
|
||||||
{
|
{
|
||||||
if (!sets.contains(setName))
|
if (!setsToPrintings.contains(setName))
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
for (const auto &set : sets[setName]) {
|
for (const auto &set : setsToPrintings[setName]) {
|
||||||
if (QLatin1String("card_") + this->getName() + QString("_") + QString(set.getProperty("uuid")) ==
|
if (QLatin1String("card_") + this->getName() + QString("_") + QString(set.getProperty("uuid")) ==
|
||||||
this->getPixmapCacheKey()) {
|
this->getPixmapCacheKey()) {
|
||||||
return set.getProperty(propertyName);
|
return set.getProperty(propertyName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return sets[setName][0].getProperty(propertyName);
|
return setsToPrintings[setName][0].getProperty(propertyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// related cards
|
// related cards
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue