mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 09:04:53 -07:00
fix: Use isRebalanced to detect Arena cards (#5778)
* fix: Use isRebalanced to detect Arena cards In #5759 we introduced a setting (off by default) to disable the use of Arena cards. This was done by checking the `isOnlineOnly` property of the card, which accidentally also disabled online *printings* of cards that otherwise exist in paper (e.g. Vintage Masters). This PR does the same thing but uses the `isRebalanced` property instead, which is `true` for Arena cards only and should have been used from the start. This setting does not impact online-only printings such as Vintage Masters. The settings is still on by default. * Update setting to mention Alchemy rather than Arena
This commit is contained in:
parent
70f2a32fad
commit
2fcdb52157
9 changed files with 31 additions and 26 deletions
|
|
@ -163,10 +163,11 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
|
|||
sortWarning->setLayout(sortWarningLayout);
|
||||
sortWarning->setVisible(false);
|
||||
|
||||
includeOnlineOnlyCards = SettingsCache::instance().getIncludeOnlineOnlyCards();
|
||||
QCheckBox *onlineOnly = new QCheckBox(tr("Include online-only (Arena) cards [requires restart]"));
|
||||
onlineOnly->setChecked(includeOnlineOnlyCards);
|
||||
connect(onlineOnly, &QAbstractButton::toggled, this, &WndSets::includeOnlineOnlyCardsChanged);
|
||||
includeRebalancedCards = SettingsCache::instance().getIncludeRebalancedCards();
|
||||
QCheckBox *includeRebalancedCardsCheckBox =
|
||||
new QCheckBox(tr("Include cards rebalanced for Alchemy [requires restart]"));
|
||||
includeRebalancedCardsCheckBox->setChecked(includeRebalancedCards);
|
||||
connect(includeRebalancedCardsCheckBox, &QAbstractButton::toggled, this, &WndSets::includeRebalancedCardsChanged);
|
||||
|
||||
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(actSave()));
|
||||
|
|
@ -181,7 +182,7 @@ WndSets::WndSets(QWidget *parent) : QMainWindow(parent)
|
|||
mainLayout->addWidget(enableSomeButton, 2, 1);
|
||||
mainLayout->addWidget(disableSomeButton, 2, 2);
|
||||
mainLayout->addWidget(sortWarning, 3, 1, 1, 2);
|
||||
mainLayout->addWidget(onlineOnly, 4, 1, 1, 2);
|
||||
mainLayout->addWidget(includeRebalancedCardsCheckBox, 4, 1, 1, 2);
|
||||
mainLayout->addWidget(hintsGroupBox, 5, 1, 1, 2);
|
||||
mainLayout->addWidget(buttonBox, 6, 1, 1, 2);
|
||||
mainLayout->setColumnStretch(1, 1);
|
||||
|
|
@ -246,15 +247,15 @@ void WndSets::rebuildMainLayout(int actionToTake)
|
|||
}
|
||||
}
|
||||
|
||||
void WndSets::includeOnlineOnlyCardsChanged(bool _includeOnlineOnlyCards)
|
||||
void WndSets::includeRebalancedCardsChanged(bool _includeRebalancedCards)
|
||||
{
|
||||
includeOnlineOnlyCards = _includeOnlineOnlyCards;
|
||||
includeRebalancedCards = _includeRebalancedCards;
|
||||
}
|
||||
|
||||
void WndSets::actSave()
|
||||
{
|
||||
model->save(CardDatabaseManager::getInstance());
|
||||
SettingsCache::instance().setIncludeOnlineOnlyCards(includeOnlineOnlyCards);
|
||||
SettingsCache::instance().setIncludeRebalancedCards(includeRebalancedCards);
|
||||
PictureLoader::clearPixmapCache();
|
||||
close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ private:
|
|||
void saveHeaderState();
|
||||
void rebuildMainLayout(int actionToTake);
|
||||
bool setOrderIsSorted;
|
||||
bool includeOnlineOnlyCards;
|
||||
bool includeRebalancedCards;
|
||||
enum
|
||||
{
|
||||
NO_SETS_SELECTED,
|
||||
|
|
@ -74,7 +74,7 @@ private slots:
|
|||
void actDisableResetButton(const QString &filterText);
|
||||
void actSort(int index);
|
||||
void actIgnoreWarning();
|
||||
void includeOnlineOnlyCardsChanged(bool _includeOnlineOnlyCardsChanged);
|
||||
void includeRebalancedCardsChanged(bool _includeRebalancedCardsChanged);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue