fix RepeatPoint animations

- FadeIn and -Out for RepeatPoints are now calculated instead of fixed values
- TimePreempt is now cut down if too long for RepeatPoints following the first one to only show up to two RepeatPoints at any given time
This commit is contained in:
Aergwyn
2018-01-22 12:36:38 +01:00
parent 85d1e81a92
commit 66176f2882
5 changed files with 36 additions and 26 deletions

View File

@ -17,7 +17,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
private readonly DrawableSlider drawableSlider;
public double FadeInTime;
public double FadeOutTime;
private double animDuration;
public DrawableRepeatPoint(RepeatPoint repeatPoint, DrawableSlider drawableSlider)
: base(repeatPoint)
@ -48,11 +48,11 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected override void UpdatePreemptState()
{
var animIn = Math.Min(150, repeatPoint.StartTime - FadeInTime);
animDuration = Math.Min(150, repeatPoint.StartTime - FadeInTime);
this.FadeIn(animIn).ScaleTo(1.2f, animIn)
this.FadeIn(animDuration).ScaleTo(1.2f, animDuration / 2)
.Then()
.ScaleTo(1, 150, Easing.Out);
.ScaleTo(1, animDuration / 2, Easing.Out);
}
protected override void UpdateCurrentState(ArmedState state)
@ -60,14 +60,14 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
switch (state)
{
case ArmedState.Idle:
this.Delay(FadeOutTime - repeatPoint.StartTime).FadeOut();
this.Delay(HitObject.TimePreempt).FadeOut();
break;
case ArmedState.Miss:
this.FadeOut(160);
this.FadeOut(animDuration);
break;
case ArmedState.Hit:
this.FadeOut(120, Easing.OutQuint)
.ScaleTo(Scale * 1.5f, 120, Easing.OutQuint);
this.FadeOut(animDuration, Easing.OutQuint)
.ScaleTo(Scale * 1.5f, animDuration, Easing.OutQuint);
break;
}
}