1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 19:27:26 +08:00

Debounce user-requested replay seeks

This commit is contained in:
smoogipoo 2019-09-17 16:12:18 +09:00
parent e5149b4be9
commit f0bcb2b933

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.MathUtils;
using osu.Framework.Threading;
namespace osu.Game.Screens.Play
{
@ -121,6 +122,12 @@ namespace osu.Game.Screens.Play
handleBase.X = newX;
}
protected override void OnUserChange(double value) => OnSeek?.Invoke(value);
private ScheduledDelegate scheduledSeek;
protected override void OnUserChange(double value)
{
scheduledSeek?.Cancel();
scheduledSeek = Schedule(() => OnSeek?.Invoke(value));
}
}
}