mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-29 09:22:18 -07:00
Add an arrow draw animation setting
- New arrowDrawAnimation cards-display setting, default on - The arrow draw animation checkbox joins the animation settings group - Visual Deck Storage selection animation checkbox moves next to the other animation checkboxes, and the enable/disable-all buttons now cover it and the arrow animation Took 2 minutes Took 21 minutes Took 7 minutes Took 11 minutes Took 20 seconds
This commit is contained in:
parent
1eca89d75a
commit
48a02589a9
6 changed files with 30 additions and 2 deletions
|
|
@ -116,6 +116,10 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
connect(&tapAnimationCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().cardsDisplay(),
|
||||
&CardsDisplaySettings::setTapAnimation);
|
||||
|
||||
arrowDrawAnimationCheckBox.setChecked(SettingsCache::instance().cardsDisplay().getArrowDrawAnimation());
|
||||
connect(&arrowDrawAnimationCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().cardsDisplay(),
|
||||
&CardsDisplaySettings::setArrowDrawAnimation);
|
||||
|
||||
lifeCounterAnimationsCheckBox.setChecked(
|
||||
SettingsCache::instance().userInterface().getLifeCounterAnimationsEnabled());
|
||||
connect(&lifeCounterAnimationsCheckBox, &QCheckBox::QT_STATE_CHANGED, &SettingsCache::instance().userInterface(),
|
||||
|
|
@ -132,8 +136,9 @@ UserInterfaceSettingsPage::UserInterfaceSettingsPage()
|
|||
animationGrid->addWidget(&enableAllAnimationsButton, 0, 0);
|
||||
animationGrid->addWidget(&disableAllAnimationsButton, 0, 1);
|
||||
animationGrid->addWidget(&tapAnimationCheckBox, 1, 0);
|
||||
animationGrid->addWidget(&lifeCounterAnimationsCheckBox, 2, 0);
|
||||
animationGrid->addWidget(&battlefieldFlashCheckBox, 3, 0);
|
||||
animationGrid->addWidget(&arrowDrawAnimationCheckBox, 2, 0);
|
||||
animationGrid->addWidget(&lifeCounterAnimationsCheckBox, 3, 0);
|
||||
animationGrid->addWidget(&battlefieldFlashCheckBox, 4, 0);
|
||||
|
||||
animationGroupBox = new QGroupBox;
|
||||
animationGroupBox->setLayout(animationGrid);
|
||||
|
|
@ -287,6 +292,7 @@ void UserInterfaceSettingsPage::setNotificationEnabled(QT_STATE_CHANGED_T i)
|
|||
void UserInterfaceSettingsPage::enableAllAnimations()
|
||||
{
|
||||
tapAnimationCheckBox.setChecked(true);
|
||||
arrowDrawAnimationCheckBox.setChecked(true);
|
||||
lifeCounterAnimationsCheckBox.setChecked(true);
|
||||
battlefieldFlashCheckBox.setChecked(true);
|
||||
}
|
||||
|
|
@ -294,6 +300,7 @@ void UserInterfaceSettingsPage::enableAllAnimations()
|
|||
void UserInterfaceSettingsPage::disableAllAnimations()
|
||||
{
|
||||
tapAnimationCheckBox.setChecked(false);
|
||||
arrowDrawAnimationCheckBox.setChecked(false);
|
||||
lifeCounterAnimationsCheckBox.setChecked(false);
|
||||
battlefieldFlashCheckBox.setChecked(false);
|
||||
}
|
||||
|
|
@ -343,6 +350,7 @@ void UserInterfaceSettingsPage::retranslateUi()
|
|||
enableAllAnimationsButton.setText(tr("&Enable all animations"));
|
||||
disableAllAnimationsButton.setText(tr("&Disable all animations"));
|
||||
tapAnimationCheckBox.setText(tr("&Tap/untap animation"));
|
||||
arrowDrawAnimationCheckBox.setText(tr("&Arrow draw animation"));
|
||||
lifeCounterAnimationsCheckBox.setText(tr("Life counter flash"));
|
||||
battlefieldFlashCheckBox.setText(tr("Battlefield flash on damage"));
|
||||
deckEditorGroupBox->setTitle(tr("Deck editor/storage settings"));
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ private:
|
|||
QPushButton enableAllAnimationsButton;
|
||||
QPushButton disableAllAnimationsButton;
|
||||
QCheckBox tapAnimationCheckBox;
|
||||
QCheckBox arrowDrawAnimationCheckBox;
|
||||
QCheckBox lifeCounterAnimationsCheckBox;
|
||||
QCheckBox battlefieldFlashCheckBox;
|
||||
QCheckBox openDeckInNewTabCheckBox;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ public:
|
|||
[[nodiscard]] virtual bool getIncludeRebalancedCards() const = 0;
|
||||
[[nodiscard]] virtual bool getPrintingSelectorNavigationButtonsVisible() const = 0;
|
||||
[[nodiscard]] virtual bool getTapAnimation() const = 0;
|
||||
[[nodiscard]] virtual bool getArrowDrawAnimation() const = 0;
|
||||
[[nodiscard]] virtual bool getAutoRotateSidewaysLayoutCards() const = 0;
|
||||
[[nodiscard]] virtual bool getScaleCards() const = 0;
|
||||
[[nodiscard]] virtual int getStackCardOverlapPercent() const = 0;
|
||||
|
|
|
|||
|
|
@ -50,6 +50,11 @@ bool CardsDisplaySettings::getTapAnimation() const
|
|||
return getValue("tapAnimation", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getArrowDrawAnimation() const
|
||||
{
|
||||
return getValue("arrowDrawAnimation", QString(), QString(), true).toBool();
|
||||
}
|
||||
|
||||
bool CardsDisplaySettings::getAutoRotateSidewaysLayoutCards() const
|
||||
{
|
||||
return getValue("autoRotateSidewaysLayoutCards", QString(), QString(), true).toBool();
|
||||
|
|
@ -159,6 +164,11 @@ void CardsDisplaySettings::setTapAnimation(bool _tapAnimation)
|
|||
setValue(_tapAnimation, "tapAnimation");
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setArrowDrawAnimation(bool _arrowDrawAnimation)
|
||||
{
|
||||
setValue(_arrowDrawAnimation, "arrowDrawAnimation");
|
||||
}
|
||||
|
||||
void CardsDisplaySettings::setAutoRotateSidewaysLayoutCards(bool _autoRotateSidewaysLayoutCards)
|
||||
{
|
||||
setValue(_autoRotateSidewaysLayoutCards, "autoRotateSidewaysLayoutCards");
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public:
|
|||
[[nodiscard]] bool getIncludeRebalancedCards() const override;
|
||||
[[nodiscard]] bool getPrintingSelectorNavigationButtonsVisible() const override;
|
||||
[[nodiscard]] bool getTapAnimation() const override;
|
||||
[[nodiscard]] bool getArrowDrawAnimation() const override;
|
||||
[[nodiscard]] bool getAutoRotateSidewaysLayoutCards() const override;
|
||||
[[nodiscard]] bool getScaleCards() const override;
|
||||
[[nodiscard]] int getStackCardOverlapPercent() const override;
|
||||
|
|
@ -40,6 +41,7 @@ public:
|
|||
void setIncludeRebalancedCards(bool _includeRebalancedCards);
|
||||
void setPrintingSelectorNavigationButtonsVisible(bool _navigationButtonsVisible);
|
||||
void setTapAnimation(bool _tapAnimation);
|
||||
void setArrowDrawAnimation(bool _arrowDrawAnimation);
|
||||
void setAutoRotateSidewaysLayoutCards(bool _autoRotateSidewaysLayoutCards);
|
||||
void setCardScaling(bool _scaleCards);
|
||||
void setStackCardOverlapPercent(int _verticalCardOverlapPercent);
|
||||
|
|
|
|||
|
|
@ -476,6 +476,12 @@ TEST_F(SettingsDefaultsTest, CardsDisplay_SampleHandSize_Default)
|
|||
ASSERT_EQ(s.getSampleHandSize(), 7);
|
||||
}
|
||||
|
||||
TEST_F(SettingsDefaultsTest, CardsDisplay_ArrowDrawAnimation_Default)
|
||||
{
|
||||
CardsDisplaySettings s(settingsPath, nullptr);
|
||||
ASSERT_EQ(s.getArrowDrawAnimation(), true);
|
||||
}
|
||||
|
||||
// --- VisualDeckStorageSettings ---
|
||||
|
||||
TEST_F(SettingsDefaultsTest, VisualDeckStorage_SortingOrder_Default)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue