Implement flashlight dimming on slider slide

This commit is contained in:
David Zhao
2019-04-12 10:47:22 +09:00
parent 67a03bbc90
commit 664a4ba540
4 changed files with 48 additions and 5 deletions

View File

@ -44,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
protected override void CheckForResult(bool userTriggered, double timeOffset)
{
if (repeatPoint.StartTime <= Time.Current)
ApplyResult(r => r.Type = drawableSlider.Tracking ? HitResult.Great : HitResult.Miss);
ApplyResult(r => r.Type = drawableSlider.Tracking.Value ? HitResult.Great : HitResult.Miss);
}
protected override void UpdatePreemptState()

View File

@ -130,13 +130,13 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
}
}
public bool Tracking;
public readonly Bindable<bool> Tracking = new Bindable<bool>();
protected override void Update()
{
base.Update();
Tracking = Ball.Tracking;
Tracking.Value = Ball.Tracking;
double completionProgress = MathHelper.Clamp((Time.Current - slider.StartTime) / slider.Duration, 0, 1);