[Game] Animate life counter manipulation (#7100)

* Add animations toggles for the life counter and battlefield

Per-effect toggles plus Enable/Disable-all buttons: a life-counter
flash on loss and a crimson battlefield shimmer on damage.


Took 24 seconds

* Animate life changes with a counter flash and battlefield shimmer

- Life loss/gain pulses the player life counter with a brief flash
- The battlefield table zone shimmers crimson on damage
- Respects the per-effect animation toggles

Both effects drive their decay from GameScene's shared animation timer
through the IAnimatedItem interface (QElapsedTimer based), instead of
owning per-item QTimers.

Took 8 minutes

* Revert unintentional cherry picks

Took 2 minutes

* Lambda to re-use path calculation.

Took 8 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-08-13 19:12:12 +02:00 committed by GitHub
parent 12a5b34e42
commit 9d26e07165
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 196 additions and 12 deletions

View file

@ -160,6 +160,16 @@ bool InterfaceSettings::getShowGameSelectorFilterToolbar() const
return getValue("showGameSelectorFilterToolbar", QString(), QString(), true).toBool();
}
bool InterfaceSettings::getLifeCounterAnimationsEnabled() const
{
return getValue("lifeCounterAnimationsEnabled", QString(), QString(), true).toBool();
}
bool InterfaceSettings::getBattlefieldFlashEnabled() const
{
return getValue("battlefieldFlashEnabled", QString(), QString(), true).toBool();
}
void InterfaceSettings::setUseTearOffMenus(bool _useTearOffMenus)
{
setValue(_useTearOffMenus, "useTearOffMenus");
@ -326,3 +336,15 @@ void InterfaceSettings::setShowGameSelectorFilterToolbar(bool _showGameSelectorF
setValue(_showGameSelectorFilterToolbar, "showGameSelectorFilterToolbar");
emit showGameSelectorFilterToolbarChanged(_showGameSelectorFilterToolbar);
}
void InterfaceSettings::setLifeCounterAnimationsEnabled(bool _lifeCounterAnimationsEnabled)
{
setValue(_lifeCounterAnimationsEnabled, "lifeCounterAnimationsEnabled");
emit lifeCounterAnimationsEnabledChanged(_lifeCounterAnimationsEnabled);
}
void InterfaceSettings::setBattlefieldFlashEnabled(bool _battlefieldFlashEnabled)
{
setValue(_battlefieldFlashEnabled, "battlefieldFlashEnabled");
emit battlefieldFlashEnabledChanged(_battlefieldFlashEnabled);
}

View file

@ -42,6 +42,8 @@ public:
[[nodiscard]] bool getShowStatusBar() const override;
[[nodiscard]] bool getShowShortcuts() const override;
[[nodiscard]] bool getShowGameSelectorFilterToolbar() const override;
[[nodiscard]] bool getLifeCounterAnimationsEnabled() const override;
[[nodiscard]] bool getBattlefieldFlashEnabled() const override;
void setUseTearOffMenus(bool _useTearOffMenus);
void setCardViewInitialRowsMax(int _cardViewInitialRowsMax);
@ -74,6 +76,8 @@ public:
void setShowStatusBar(bool _showStatusBar);
void setShowShortcuts(bool _showShortcuts);
void setShowGameSelectorFilterToolbar(bool _showGameSelectorFilterToolbar);
void setLifeCounterAnimationsEnabled(bool _lifeCounterAnimationsEnabled);
void setBattlefieldFlashEnabled(bool _battlefieldFlashEnabled);
signals:
void useTearOffMenusChanged(bool state);
@ -85,6 +89,8 @@ signals:
void tallyTypeChanged(int type);
void showStatusBarChanged(bool state);
void showGameSelectorFilterToolbarChanged(bool state);
void lifeCounterAnimationsEnabledChanged(bool state);
void battlefieldFlashEnabledChanged(bool state);
public:
explicit InterfaceSettings(const QString &settingPath, QObject *parent = nullptr);