mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[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:
parent
12a5b34e42
commit
9d26e07165
12 changed files with 196 additions and 12 deletions
|
|
@ -188,6 +188,11 @@ void PlayerGraphicsItem::onCounterAdded(CounterState *state)
|
|||
AbstractCounter *widget;
|
||||
if (state->getName() == "life") {
|
||||
widget = playerTarget->addCounter(state);
|
||||
connect(state, &CounterState::valueChanged, this, [this](int oldValue, int newValue) {
|
||||
if (newValue < oldValue) {
|
||||
tableZoneGraphicsItem->triggerDamageShimmer();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
widget = new GeneralCounter(state, player, true, this);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue