mirror of
https://github.com/osukey/osukey.git
synced 2025-07-04 01:40:02 +09:00
Add debounce testing
This commit is contained in:
@ -73,6 +73,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
|
||||
private Cached layout = new Cached();
|
||||
private ScheduledDelegate scheduledCreate;
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
@ -80,27 +81,21 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
if (values != null && !layout.IsValid)
|
||||
{
|
||||
schedulerRecreateGraph();
|
||||
columns?.FadeOut(500, Easing.OutQuint).Expire();
|
||||
|
||||
scheduledCreate?.Cancel();
|
||||
scheduledCreate = Scheduler.AddDelayed(RecreateGraph, 500);
|
||||
|
||||
layout.Validate();
|
||||
}
|
||||
}
|
||||
|
||||
private ScheduledDelegate scheduledCreate;
|
||||
private CancellationTokenSource cts;
|
||||
|
||||
/// <summary>
|
||||
/// Recreates the entire graph.
|
||||
/// </summary>
|
||||
private void schedulerRecreateGraph()
|
||||
{
|
||||
columns?.FadeOut(500, Easing.OutQuint).Expire();
|
||||
|
||||
scheduledCreate?.Cancel();
|
||||
scheduledCreate = Scheduler.AddDelayed(recreateGraph, 500);
|
||||
}
|
||||
|
||||
private CancellationTokenSource cts;
|
||||
|
||||
private void recreateGraph()
|
||||
protected virtual void RecreateGraph()
|
||||
{
|
||||
var newColumns = new BufferedContainer<Column>
|
||||
{
|
||||
|
Reference in New Issue
Block a user