Skip to content

Commit

Permalink
Fix flashlight dim being applied before slider start time
Browse files Browse the repository at this point in the history
Closes ppy#26515.

Compare ppy#26053.
  • Loading branch information
bdach committed Jan 14, 2024
1 parent f85e6ad commit 0b2b1fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public partial class OsuModFlashlight : ModFlashlight<OsuHitObject>, IApplicable
public void ApplyToDrawableHitObject(DrawableHitObject drawable)
{
if (drawable is DrawableSlider s)
s.Tracking.ValueChanged += flashlight.OnSliderTrackingChange;
s.Tracking.ValueChanged += _ => flashlight.OnSliderTrackingChange(s);
}

private partial class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition
Expand All @@ -66,10 +66,10 @@ public OsuFlashlight(OsuModFlashlight modFlashlight)
FlashlightSmoothness = 1.4f;
}

public void OnSliderTrackingChange(ValueChangedEvent<bool> e)
public void OnSliderTrackingChange(DrawableSlider e)
{
// If a slider is in a tracking state, a further dim should be applied to the (remaining) visible portion of the playfield.
FlashlightDim = e.NewValue ? 0.8f : 0.0f;
FlashlightDim = Time.Current >= e.HitObject.StartTime && e.Tracking.Value ? 0.8f : 0.0f;
}

protected override bool OnMouseMove(MouseMoveEvent e)
Expand Down

0 comments on commit 0b2b1fc

Please sign in to comment.