mirror of https://github.com/ppy/osu
Fix kiai flash being visible and incorrectly sized during hit animation
This commit is contained in:
parent
73f53328cf
commit
de1d473d29
|
@ -44,7 +44,7 @@ public partial class ArgonMainCirclePiece : CompositeDrawable
|
||||||
private readonly IBindable<Color4> accentColour = new Bindable<Color4>();
|
private readonly IBindable<Color4> accentColour = new Bindable<Color4>();
|
||||||
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
|
private readonly IBindable<int> indexInCurrentCombo = new Bindable<int>();
|
||||||
private readonly FlashPiece flash;
|
private readonly FlashPiece flash;
|
||||||
private readonly KiaiFlash kiaiFlash;
|
private readonly Container kiaiContainer;
|
||||||
|
|
||||||
private Bindable<bool> configHitLighting = null!;
|
private Bindable<bool> configHitLighting = null!;
|
||||||
|
|
||||||
|
@ -83,11 +83,13 @@ public ArgonMainCirclePiece(bool withOuterFill)
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
},
|
},
|
||||||
new CircularContainer
|
kiaiContainer = new CircularContainer
|
||||||
{
|
{
|
||||||
Masking = true,
|
Masking = true,
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
Size = Size,
|
Size = Size,
|
||||||
Child = kiaiFlash = new KiaiFlash
|
Child = new KiaiFlash
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
}
|
}
|
||||||
|
@ -129,7 +131,7 @@ protected override void LoadComplete()
|
||||||
outerGradient.ClearTransforms(targetMember: nameof(Colour));
|
outerGradient.ClearTransforms(targetMember: nameof(Colour));
|
||||||
outerGradient.Colour = ColourInfo.GradientVertical(colour.NewValue, colour.NewValue.Darken(0.1f));
|
outerGradient.Colour = ColourInfo.GradientVertical(colour.NewValue, colour.NewValue.Darken(0.1f));
|
||||||
|
|
||||||
kiaiFlash.Colour = colour.NewValue;
|
kiaiContainer.Colour = colour.NewValue;
|
||||||
outerFill.Colour = innerFill.Colour = colour.NewValue.Darken(4);
|
outerFill.Colour = innerFill.Colour = colour.NewValue.Darken(4);
|
||||||
innerGradient.Colour = ColourInfo.GradientVertical(colour.NewValue.Darken(0.5f), colour.NewValue.Darken(0.6f));
|
innerGradient.Colour = ColourInfo.GradientVertical(colour.NewValue.Darken(0.5f), colour.NewValue.Darken(0.6f));
|
||||||
flash.Colour = colour.NewValue;
|
flash.Colour = colour.NewValue;
|
||||||
|
@ -191,6 +193,11 @@ private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedSta
|
||||||
// gradient layers.
|
// gradient layers.
|
||||||
border.ResizeTo(Size * shrink_size + new Vector2(border.BorderThickness), resize_duration, Easing.OutElasticHalf);
|
border.ResizeTo(Size * shrink_size + new Vector2(border.BorderThickness), resize_duration, Easing.OutElasticHalf);
|
||||||
|
|
||||||
|
// Kiai flash should track the overall size but also be cleaned up quite fast, so we don't get additional
|
||||||
|
// flashes after the hit animation is already in a mostly-completed state.
|
||||||
|
kiaiContainer.ResizeTo(Size * shrink_size, resize_duration, Easing.OutElasticHalf);
|
||||||
|
kiaiContainer.FadeOut(flash_in_duration, Easing.OutQuint);
|
||||||
|
|
||||||
// The outer gradient is resize with a slight delay from the border.
|
// The outer gradient is resize with a slight delay from the border.
|
||||||
// This is to give it a bomb-like effect, with the border "triggering" its animation when getting close.
|
// This is to give it a bomb-like effect, with the border "triggering" its animation when getting close.
|
||||||
using (BeginDelayedSequence(flash_in_duration / 12))
|
using (BeginDelayedSequence(flash_in_duration / 12))
|
||||||
|
|
Loading…
Reference in New Issue