mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-24 10:23:02 -07:00
[DeckEditor] Show card counts in Visual Deck Editor banners (#7339)
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
7a41dfe175
commit
71ef36374d
10 changed files with 108 additions and 13 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
#include "card_group_display_widget.h"
|
#include "card_group_display_widget.h"
|
||||||
|
|
||||||
|
#include "../../../../client/settings/cache_settings.h"
|
||||||
#include "../card_info_picture_with_text_overlay_widget.h"
|
#include "../card_info_picture_with_text_overlay_widget.h"
|
||||||
|
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
#include <libcockatrice/card/database/card_database_manager.h>
|
#include <libcockatrice/card/database/card_database_manager.h>
|
||||||
#include <libcockatrice/models/deck_list/deck_list_model.h>
|
#include <libcockatrice/models/deck_list/deck_list_model.h>
|
||||||
#include <libcockatrice/models/deck_list/deck_list_sort_filter_proxy_model.h>
|
#include <libcockatrice/models/deck_list/deck_list_sort_filter_proxy_model.h>
|
||||||
|
#include <libcockatrice/settings/cards_display_settings.h>
|
||||||
|
|
||||||
CardGroupDisplayWidget::CardGroupDisplayWidget(QWidget *parent,
|
CardGroupDisplayWidget::CardGroupDisplayWidget(QWidget *parent,
|
||||||
DeckListModel *_deckListModel,
|
DeckListModel *_deckListModel,
|
||||||
|
|
@ -30,6 +32,7 @@ CardGroupDisplayWidget::CardGroupDisplayWidget(QWidget *parent,
|
||||||
layout->addWidget(banner);
|
layout->addWidget(banner);
|
||||||
|
|
||||||
CardGroupDisplayWidget::updateCardDisplays();
|
CardGroupDisplayWidget::updateCardDisplays();
|
||||||
|
updateCardCount();
|
||||||
|
|
||||||
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &CardGroupDisplayWidget::onCardAddition);
|
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &CardGroupDisplayWidget::onCardAddition);
|
||||||
if (selectionModel) {
|
if (selectionModel) {
|
||||||
|
|
@ -38,6 +41,11 @@ CardGroupDisplayWidget::CardGroupDisplayWidget(QWidget *parent,
|
||||||
}
|
}
|
||||||
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &CardGroupDisplayWidget::onCardRemoval);
|
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &CardGroupDisplayWidget::onCardRemoval);
|
||||||
connect(deckListModel, &QAbstractItemModel::dataChanged, this, &CardGroupDisplayWidget::onDataChanged);
|
connect(deckListModel, &QAbstractItemModel::dataChanged, this, &CardGroupDisplayWidget::onDataChanged);
|
||||||
|
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &CardGroupDisplayWidget::updateCardCount);
|
||||||
|
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &CardGroupDisplayWidget::updateCardCount);
|
||||||
|
connect(deckListModel, &QAbstractItemModel::dataChanged, this, &CardGroupDisplayWidget::updateCardCount);
|
||||||
|
connect(&SettingsCache::instance().cardsDisplay(), &CardsDisplaySettings::visualDeckEditorShowCardCountsChanged,
|
||||||
|
this, &CardGroupDisplayWidget::updateCardCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Just here so it can get overwritten in subclasses.
|
// Just here so it can get overwritten in subclasses.
|
||||||
|
|
@ -348,4 +356,22 @@ void CardGroupDisplayWidget::onActiveSortCriteriaChanged(QStringList _activeSort
|
||||||
|
|
||||||
clearAllDisplayWidgets();
|
clearAllDisplayWidgets();
|
||||||
updateCardDisplays();
|
updateCardDisplays();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CardGroupDisplayWidget::updateCardCount()
|
||||||
|
{
|
||||||
|
if (!banner || !deckListModel || !trackedIndex.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString text = cardGroupCategory;
|
||||||
|
if (SettingsCache::instance().cardsDisplay().getVisualDeckEditorShowCardCounts()) {
|
||||||
|
int total = 0;
|
||||||
|
for (int i = 0; i < deckListModel->rowCount(trackedIndex); ++i) {
|
||||||
|
total +=
|
||||||
|
deckListModel->index(i, DeckListModelColumns::CARD_AMOUNT, trackedIndex).data(Qt::EditRole).toInt();
|
||||||
|
}
|
||||||
|
text += QStringLiteral(" (%1)").arg(total);
|
||||||
|
}
|
||||||
|
banner->setText(text);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ public slots:
|
||||||
virtual void onCardRemoval(const QModelIndex &parent, int first, int last);
|
virtual void onCardRemoval(const QModelIndex &parent, int first, int last);
|
||||||
void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
|
void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
|
||||||
void onActiveSortCriteriaChanged(QStringList activeSortCriteria);
|
void onActiveSortCriteriaChanged(QStringList activeSortCriteria);
|
||||||
|
void updateCardCount();
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
#include "deck_card_zone_display_widget.h"
|
#include "deck_card_zone_display_widget.h"
|
||||||
|
|
||||||
|
#include "../../../client/settings/cache_settings.h"
|
||||||
#include "card_group_display_widgets/flat_card_group_display_widget.h"
|
#include "card_group_display_widgets/flat_card_group_display_widget.h"
|
||||||
#include "card_group_display_widgets/overlapped_card_group_display_widget.h"
|
#include "card_group_display_widgets/overlapped_card_group_display_widget.h"
|
||||||
#include "libcockatrice/card/database/card_database_manager.h"
|
#include "libcockatrice/card/database/card_database_manager.h"
|
||||||
|
#include "libcockatrice/settings/cards_display_settings.h"
|
||||||
|
|
||||||
#include <QResizeEvent>
|
#include <QResizeEvent>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
@ -39,6 +41,7 @@ DeckCardZoneDisplayWidget::DeckCardZoneDisplayWidget(QWidget *parent,
|
||||||
banner->setBuddy(cardGroupContainer);
|
banner->setBuddy(cardGroupContainer);
|
||||||
|
|
||||||
displayCards();
|
displayCards();
|
||||||
|
updateZoneCardCount();
|
||||||
|
|
||||||
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &DeckCardZoneDisplayWidget::onCategoryAddition);
|
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &DeckCardZoneDisplayWidget::onCategoryAddition);
|
||||||
if (selectionModel) {
|
if (selectionModel) {
|
||||||
|
|
@ -46,6 +49,11 @@ DeckCardZoneDisplayWidget::DeckCardZoneDisplayWidget(QWidget *parent,
|
||||||
&DeckCardZoneDisplayWidget::onSelectionChanged);
|
&DeckCardZoneDisplayWidget::onSelectionChanged);
|
||||||
}
|
}
|
||||||
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &DeckCardZoneDisplayWidget::onCategoryRemoval);
|
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &DeckCardZoneDisplayWidget::onCategoryRemoval);
|
||||||
|
connect(deckListModel, &QAbstractItemModel::rowsInserted, this, &DeckCardZoneDisplayWidget::updateZoneCardCount);
|
||||||
|
connect(deckListModel, &QAbstractItemModel::rowsRemoved, this, &DeckCardZoneDisplayWidget::updateZoneCardCount);
|
||||||
|
connect(deckListModel, &QAbstractItemModel::dataChanged, this, &DeckCardZoneDisplayWidget::updateZoneCardCount);
|
||||||
|
connect(&SettingsCache::instance().cardsDisplay(), &CardsDisplaySettings::visualDeckEditorShowCardCountsChanged,
|
||||||
|
this, &DeckCardZoneDisplayWidget::updateZoneCardCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =====================================================================================================================
|
// =====================================================================================================================
|
||||||
|
|
@ -245,3 +253,21 @@ QList<QString> DeckCardZoneDisplayWidget::getGroupCriteriaValueList()
|
||||||
|
|
||||||
return groupCriteriaValues;
|
return groupCriteriaValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeckCardZoneDisplayWidget::updateZoneCardCount()
|
||||||
|
{
|
||||||
|
if (!banner || !deckListModel) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QString text = zoneName;
|
||||||
|
if (SettingsCache::instance().cardsDisplay().getVisualDeckEditorShowCardCounts()) {
|
||||||
|
int total = 0;
|
||||||
|
const auto cardNodes = deckListModel->getCardNodesForZone(zoneName);
|
||||||
|
for (const auto *node : cardNodes) {
|
||||||
|
total += node->getNumber();
|
||||||
|
}
|
||||||
|
text += QStringLiteral(" (%1)").arg(total);
|
||||||
|
}
|
||||||
|
banner->setText(text);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ public slots:
|
||||||
QList<QString> getGroupCriteriaValueList();
|
QList<QString> getGroupCriteriaValueList();
|
||||||
void onCategoryAddition(const QModelIndex &parent, int first, int last);
|
void onCategoryAddition(const QModelIndex &parent, int first, int last);
|
||||||
void onCategoryRemoval(const QModelIndex &parent, int first, int last);
|
void onCategoryRemoval(const QModelIndex &parent, int first, int last);
|
||||||
|
void updateZoneCardCount();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void cardClicked(QMouseEvent *event, const ExactCard &card, const QString &zoneName);
|
void cardClicked(QMouseEvent *event, const ExactCard &card, const QString &zoneName);
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,11 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
connect(&openDeckInNewTabCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().deckEditor(),
|
connect(&openDeckInNewTabCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().deckEditor(),
|
||||||
&DeckEditorSettings::setOpenDeckInNewTab);
|
&DeckEditorSettings::setOpenDeckInNewTab);
|
||||||
|
|
||||||
|
visualDeckEditorShowCardCountsCheckBox.setChecked(
|
||||||
|
SettingsCache::instance().cardsDisplay().getVisualDeckEditorShowCardCounts());
|
||||||
|
connect(&visualDeckEditorShowCardCountsCheckBox, &QCheckBox::QT_STATE_CHANGED,
|
||||||
|
&SettingsCache::instance().cardsDisplay(), &CardsDisplaySettings::setVisualDeckEditorShowCardCounts);
|
||||||
|
|
||||||
visualDeckStorageInGameCheckBox.setChecked(
|
visualDeckStorageInGameCheckBox.setChecked(
|
||||||
SettingsCache::instance().visualDeckStorage().getVisualDeckStorageInGame());
|
SettingsCache::instance().visualDeckStorage().getVisualDeckStorageInGame());
|
||||||
connect(&visualDeckStorageInGameCheckBox, &QCheckBox::QT_STATE_CHANGED,
|
connect(&visualDeckStorageInGameCheckBox, &QCheckBox::QT_STATE_CHANGED,
|
||||||
|
|
@ -244,18 +249,19 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
||||||
|
|
||||||
auto *deckEditorGrid = new QGridLayout;
|
auto *deckEditorGrid = new QGridLayout;
|
||||||
deckEditorGrid->addWidget(&openDeckInNewTabCheckBox, 0, 0);
|
deckEditorGrid->addWidget(&openDeckInNewTabCheckBox, 0, 0);
|
||||||
deckEditorGrid->addWidget(&visualDeckStorageInGameCheckBox, 1, 0);
|
deckEditorGrid->addWidget(&visualDeckEditorShowCardCountsCheckBox, 1, 0);
|
||||||
deckEditorGrid->addWidget(&visualDeckStorageSelectionAnimationCheckBox, 2, 0);
|
deckEditorGrid->addWidget(&visualDeckStorageInGameCheckBox, 2, 0);
|
||||||
deckEditorGrid->addWidget(&visualDeckStoragePromptForConversionLabel, 3, 0);
|
deckEditorGrid->addWidget(&visualDeckStorageSelectionAnimationCheckBox, 3, 0);
|
||||||
deckEditorGrid->addWidget(&visualDeckStoragePromptForConversionSelector, 3, 1);
|
deckEditorGrid->addWidget(&visualDeckStoragePromptForConversionLabel, 4, 0);
|
||||||
deckEditorGrid->addWidget(&defaultDeckEditorTypeLabel, 4, 0);
|
deckEditorGrid->addWidget(&visualDeckStoragePromptForConversionSelector, 4, 1);
|
||||||
deckEditorGrid->addWidget(&defaultDeckEditorTypeSelector, 4, 1);
|
deckEditorGrid->addWidget(&defaultDeckEditorTypeLabel, 5, 0);
|
||||||
deckEditorGrid->addWidget(&vdeStartupTabLabel, 5, 0);
|
deckEditorGrid->addWidget(&defaultDeckEditorTypeSelector, 5, 1);
|
||||||
deckEditorGrid->addWidget(&vdeStartupTabSelector, 5, 1);
|
deckEditorGrid->addWidget(&vdeStartupTabLabel, 6, 0);
|
||||||
deckEditorGrid->addWidget(&commanderSpellbookIntegrationEnabledLabel, 6, 0);
|
deckEditorGrid->addWidget(&vdeStartupTabSelector, 6, 1);
|
||||||
deckEditorGrid->addWidget(&commanderSpellbookIntegrationEnabledSelector, 6, 1);
|
deckEditorGrid->addWidget(&commanderSpellbookIntegrationEnabledLabel, 7, 0);
|
||||||
deckEditorGrid->addWidget(labelWidget, 7, 0);
|
deckEditorGrid->addWidget(&commanderSpellbookIntegrationEnabledSelector, 7, 1);
|
||||||
deckEditorGrid->addWidget(&commanderSpellbookIntegrationBracketNamingSelector, 7, 1);
|
deckEditorGrid->addWidget(labelWidget, 8, 0);
|
||||||
|
deckEditorGrid->addWidget(&commanderSpellbookIntegrationBracketNamingSelector, 8, 1);
|
||||||
|
|
||||||
deckEditorGroupBox = new QGroupBox;
|
deckEditorGroupBox = new QGroupBox;
|
||||||
deckEditorGroupBox->setLayout(deckEditorGrid);
|
deckEditorGroupBox->setLayout(deckEditorGrid);
|
||||||
|
|
@ -367,6 +373,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
||||||
|
|
||||||
deckEditorGroupBox->setTitle(tr("Deck editor/storage settings"));
|
deckEditorGroupBox->setTitle(tr("Deck editor/storage settings"));
|
||||||
openDeckInNewTabCheckBox.setText(tr("Open deck in new tab by default"));
|
openDeckInNewTabCheckBox.setText(tr("Open deck in new tab by default"));
|
||||||
|
visualDeckEditorShowCardCountsCheckBox.setText(tr("Show card counts in Visual Deck Editor"));
|
||||||
visualDeckStorageInGameCheckBox.setText(tr("Use visual deck storage in game lobby"));
|
visualDeckStorageInGameCheckBox.setText(tr("Use visual deck storage in game lobby"));
|
||||||
visualDeckStorageSelectionAnimationCheckBox.setText(tr("Use selection animation for Visual Deck Storage"));
|
visualDeckStorageSelectionAnimationCheckBox.setText(tr("Use selection animation for Visual Deck Storage"));
|
||||||
visualDeckStoragePromptForConversionLabel.setText(
|
visualDeckStoragePromptForConversionLabel.setText(
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ private:
|
||||||
QComboBox visualDeckStoragePromptForConversionSelector;
|
QComboBox visualDeckStoragePromptForConversionSelector;
|
||||||
QCheckBox visualDeckStorageInGameCheckBox;
|
QCheckBox visualDeckStorageInGameCheckBox;
|
||||||
QCheckBox visualDeckStorageSelectionAnimationCheckBox;
|
QCheckBox visualDeckStorageSelectionAnimationCheckBox;
|
||||||
|
QCheckBox visualDeckEditorShowCardCountsCheckBox;
|
||||||
QLabel defaultDeckEditorTypeLabel;
|
QLabel defaultDeckEditorTypeLabel;
|
||||||
QComboBox defaultDeckEditorTypeSelector;
|
QComboBox defaultDeckEditorTypeSelector;
|
||||||
QLabel vdeStartupTabLabel;
|
QLabel vdeStartupTabLabel;
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ public:
|
||||||
[[nodiscard]] virtual int getVisualDeckStorageCardSize() const = 0;
|
[[nodiscard]] virtual int getVisualDeckStorageCardSize() const = 0;
|
||||||
[[nodiscard]] virtual int getVisualDatabaseDisplayCardSize() const = 0;
|
[[nodiscard]] virtual int getVisualDatabaseDisplayCardSize() const = 0;
|
||||||
[[nodiscard]] virtual int getVisualDeckEditorCardSize() const = 0;
|
[[nodiscard]] virtual int getVisualDeckEditorCardSize() const = 0;
|
||||||
|
[[nodiscard]] virtual bool getVisualDeckEditorShowCardCounts() const = 0;
|
||||||
[[nodiscard]] virtual int getEDHRecCardSize() const = 0;
|
[[nodiscard]] virtual int getEDHRecCardSize() const = 0;
|
||||||
[[nodiscard]] virtual int getArchidektPreviewSize() const = 0;
|
[[nodiscard]] virtual int getArchidektPreviewSize() const = 0;
|
||||||
[[nodiscard]] virtual int getSampleHandSize() const = 0;
|
[[nodiscard]] virtual int getSampleHandSize() const = 0;
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,11 @@ int CardsDisplaySettings::getVisualDeckEditorCardSize() const
|
||||||
return getValue("visualDeckEditor", "cards", "cardSize", 100).toInt();
|
return getValue("visualDeckEditor", "cards", "cardSize", 100).toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CardsDisplaySettings::getVisualDeckEditorShowCardCounts() const
|
||||||
|
{
|
||||||
|
return getValue("visualDeckEditorShowCardCounts", QString(), QString(), true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
int CardsDisplaySettings::getEDHRecCardSize() const
|
int CardsDisplaySettings::getEDHRecCardSize() const
|
||||||
{
|
{
|
||||||
return getValue("edhrec", "cards", "cardSize", 100).toInt();
|
return getValue("edhrec", "cards", "cardSize", 100).toInt();
|
||||||
|
|
@ -217,6 +222,15 @@ void CardsDisplaySettings::setVisualDeckEditorCardSize(int _cardSize)
|
||||||
emit visualDeckEditorCardSizeChanged();
|
emit visualDeckEditorCardSizeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CardsDisplaySettings::setVisualDeckEditorShowCardCounts(bool _showCardCounts)
|
||||||
|
{
|
||||||
|
if (_showCardCounts == getVisualDeckEditorShowCardCounts()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setValue(_showCardCounts, "visualDeckEditorShowCardCounts");
|
||||||
|
emit visualDeckEditorShowCardCountsChanged(_showCardCounts);
|
||||||
|
}
|
||||||
|
|
||||||
void CardsDisplaySettings::setEDHRecCardSize(int _edhrecCardSize)
|
void CardsDisplaySettings::setEDHRecCardSize(int _edhrecCardSize)
|
||||||
{
|
{
|
||||||
setValue(_edhrecCardSize, "edhrec", "cards", "cardSize");
|
setValue(_edhrecCardSize, "edhrec", "cards", "cardSize");
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ public:
|
||||||
[[nodiscard]] int getVisualDeckStorageCardSize() const override;
|
[[nodiscard]] int getVisualDeckStorageCardSize() const override;
|
||||||
[[nodiscard]] int getVisualDatabaseDisplayCardSize() const override;
|
[[nodiscard]] int getVisualDatabaseDisplayCardSize() const override;
|
||||||
[[nodiscard]] int getVisualDeckEditorCardSize() const override;
|
[[nodiscard]] int getVisualDeckEditorCardSize() const override;
|
||||||
|
[[nodiscard]] bool getVisualDeckEditorShowCardCounts() const override;
|
||||||
[[nodiscard]] int getEDHRecCardSize() const override;
|
[[nodiscard]] int getEDHRecCardSize() const override;
|
||||||
[[nodiscard]] int getArchidektPreviewSize() const override;
|
[[nodiscard]] int getArchidektPreviewSize() const override;
|
||||||
[[nodiscard]] int getSampleHandSize() const override;
|
[[nodiscard]] int getSampleHandSize() const override;
|
||||||
|
|
@ -52,6 +53,7 @@ public:
|
||||||
void setVisualDeckStorageCardSize(int _cardSize);
|
void setVisualDeckStorageCardSize(int _cardSize);
|
||||||
void setVisualDatabaseDisplayCardSize(int _cardSize);
|
void setVisualDatabaseDisplayCardSize(int _cardSize);
|
||||||
void setVisualDeckEditorCardSize(int _cardSize);
|
void setVisualDeckEditorCardSize(int _cardSize);
|
||||||
|
void setVisualDeckEditorShowCardCounts(bool _showCardCounts);
|
||||||
void setEDHRecCardSize(int _edhrecCardSize);
|
void setEDHRecCardSize(int _edhrecCardSize);
|
||||||
void setArchidektPreviewCardSize(int _archidektPreviewCardSize);
|
void setArchidektPreviewCardSize(int _archidektPreviewCardSize);
|
||||||
void setSampleHandSize(int _sampleHandSize);
|
void setSampleHandSize(int _sampleHandSize);
|
||||||
|
|
@ -70,6 +72,7 @@ signals:
|
||||||
void visualDeckStorageCardSizeChanged();
|
void visualDeckStorageCardSizeChanged();
|
||||||
void visualDatabaseDisplayCardSizeChanged();
|
void visualDatabaseDisplayCardSizeChanged();
|
||||||
void visualDeckEditorCardSizeChanged();
|
void visualDeckEditorCardSizeChanged();
|
||||||
|
void visualDeckEditorShowCardCountsChanged(bool showCardCounts);
|
||||||
void edhRecCardSizeChanged();
|
void edhRecCardSizeChanged();
|
||||||
void archidektPreviewSizeChanged();
|
void archidektPreviewSizeChanged();
|
||||||
void sampleHandSizeChanged(int amount);
|
void sampleHandSizeChanged(int amount);
|
||||||
|
|
|
||||||
|
|
@ -570,6 +570,21 @@ TEST_F(SettingsDefaultsTest, CardsDisplay_VisualDeckEditorCardSize_Default)
|
||||||
ASSERT_EQ(s.getVisualDeckEditorCardSize(), 100);
|
ASSERT_EQ(s.getVisualDeckEditorCardSize(), 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(SettingsDefaultsTest, CardsDisplay_VisualDeckEditorShowCardCounts_Default)
|
||||||
|
{
|
||||||
|
CardsDisplaySettings s(settingsPath, nullptr);
|
||||||
|
ASSERT_EQ(s.getVisualDeckEditorShowCardCounts(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(SettingsDefaultsTest, CardsDisplay_VisualDeckEditorShowCardCounts_SetAndGet)
|
||||||
|
{
|
||||||
|
CardsDisplaySettings s(settingsPath, nullptr);
|
||||||
|
s.setVisualDeckEditorShowCardCounts(false);
|
||||||
|
ASSERT_EQ(s.getVisualDeckEditorShowCardCounts(), false);
|
||||||
|
s.setVisualDeckEditorShowCardCounts(true);
|
||||||
|
ASSERT_EQ(s.getVisualDeckEditorShowCardCounts(), true);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(SettingsDefaultsTest, CardsDisplay_EDHRecCardSize_Default)
|
TEST_F(SettingsDefaultsTest, CardsDisplay_EDHRecCardSize_Default)
|
||||||
{
|
{
|
||||||
CardsDisplaySettings s(settingsPath, nullptr);
|
CardsDisplaySettings s(settingsPath, nullptr);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue