1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 11:22:54 +08:00

Fix slight threading scheduling issue.

This commit is contained in:
smoogipooo 2017-03-02 12:26:42 +09:00
parent 1a4f0a92a5
commit b0d5d88fe9

View File

@ -37,7 +37,7 @@ namespace osu.Game.Screens.Tournament
private double lastTime; private double lastTime;
private ScheduledDelegate idleDelegate; private ScheduledDelegate delayedModeChangeDelegate;
public ScrollingTeamContainer() public ScrollingTeamContainer()
{ {
@ -87,11 +87,11 @@ namespace osu.Game.Screens.Tournament
{ {
_scrollState = value; _scrollState = value;
delayedModeChangeDelegate?.Cancel();
switch (value) switch (value)
{ {
case ScrollState.Scrolling: case ScrollState.Scrolling:
idleDelegate?.Cancel();
resetSelected(); resetSelected();
OnScrollStarted?.Invoke(); OnScrollStarted?.Invoke();
@ -103,7 +103,7 @@ namespace osu.Game.Screens.Tournament
speedTo(0f, 2000); speedTo(0f, 2000);
tracker.FadeIn(200); tracker.FadeIn(200);
Delay(2300).Schedule(() => scrollState = ScrollState.Stopped); delayedModeChangeDelegate = Delay(2300).Schedule(() => scrollState = ScrollState.Stopped);
break; break;
case ScrollState.Stopped: case ScrollState.Stopped:
// Find closest to center // Find closest to center
@ -135,7 +135,7 @@ namespace osu.Game.Screens.Tournament
st.Selected = true; st.Selected = true;
OnSelected?.Invoke(st); OnSelected?.Invoke(st);
idleDelegate = Delay(10000).Schedule(() => scrollState = ScrollState.Idle); delayedModeChangeDelegate = Delay(10000).Schedule(() => scrollState = ScrollState.Idle);
break; break;
case ScrollState.Idle: case ScrollState.Idle:
resetSelected(); resetSelected();