mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 01:25:10 -07:00
[Game] Animate Arrows (#7099)
* 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 * Animate arrows drawing from start to target - The arrow stroke reveals itself along the arc with an eased timing, followed by a short light sheen that sweeps down the shaft - The arrow head pops in once the reveal reaches it, then the whole arrow fades from its initial glow - Decay is driven by GameScene's shared animation timer through the IAnimatedItem interface (QElapsedTimer based), respecting the arrowDrawAnimation setting - GameScene adds the arrow item to the scene before starting its animation so the item is registered against a valid scene Took 6 minutes Took 1 minute * Defer animation start so arrows don't start halfway materialized Took 13 minutes * Don't draw tip/shaft outline Took 12 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
1eca89d75a
commit
404b0cdf28
9 changed files with 219 additions and 13 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue