1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 16:47:29 +08:00

Fix flashlight dim being applied before slider start time

Closes https://github.com/ppy/osu/issues/26515.

Compare https://github.com/ppy/osu/pull/26053.
This commit is contained in:
Bartłomiej Dach 2024-01-14 13:05:02 +01:00
parent f85e6add8e
commit 0b2b1fc588
No known key found for this signature in database

View File

@ -50,7 +50,7 @@ namespace osu.Game.Rulesets.Osu.Mods
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
@ -66,10 +66,10 @@ namespace osu.Game.Rulesets.Osu.Mods
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)