From b0d5d88fe969f9fe8c0c8a0c69435601fe9ffa0f Mon Sep 17 00:00:00 2001 From: smoogipooo Date: Thu, 2 Mar 2017 12:26:42 +0900 Subject: [PATCH] Fix slight threading scheduling issue. --- osu.Game/Screens/Tournament/ScrollingTeamContainer.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs index a79d83402e..3f82070ea7 100644 --- a/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs +++ b/osu.Game/Screens/Tournament/ScrollingTeamContainer.cs @@ -37,7 +37,7 @@ namespace osu.Game.Screens.Tournament private double lastTime; - private ScheduledDelegate idleDelegate; + private ScheduledDelegate delayedModeChangeDelegate; public ScrollingTeamContainer() { @@ -87,11 +87,11 @@ namespace osu.Game.Screens.Tournament { _scrollState = value; + delayedModeChangeDelegate?.Cancel(); + switch (value) { case ScrollState.Scrolling: - idleDelegate?.Cancel(); - resetSelected(); OnScrollStarted?.Invoke(); @@ -103,7 +103,7 @@ namespace osu.Game.Screens.Tournament speedTo(0f, 2000); tracker.FadeIn(200); - Delay(2300).Schedule(() => scrollState = ScrollState.Stopped); + delayedModeChangeDelegate = Delay(2300).Schedule(() => scrollState = ScrollState.Stopped); break; case ScrollState.Stopped: // Find closest to center @@ -135,7 +135,7 @@ namespace osu.Game.Screens.Tournament st.Selected = true; OnSelected?.Invoke(st); - idleDelegate = Delay(10000).Schedule(() => scrollState = ScrollState.Idle); + delayedModeChangeDelegate = Delay(10000).Schedule(() => scrollState = ScrollState.Idle); break; case ScrollState.Idle: resetSelected();