From 06b08cd82dafee45a767b6fe03b884ecbe4ec558 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 18 Nov 2018 09:29:18 +0900 Subject: [PATCH] Automate return to gameplay after map pool selection --- .../Screens/MapPool/MapPoolScreen.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs index 14dd990ec0..a0670fcb87 100644 --- a/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs +++ b/osu.Game.Tournament/Screens/MapPool/MapPoolScreen.cs @@ -7,11 +7,13 @@ using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Events; +using osu.Framework.Threading; using osu.Game.Beatmaps; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; using osu.Game.Tournament.Components; using osu.Game.Tournament.IPC; +using osu.Game.Tournament.Screens.Gameplay; using osu.Game.Tournament.Screens.Gameplay.Components; using osu.Game.Tournament.Screens.Ladder.Components; using OpenTK; @@ -165,6 +167,11 @@ namespace osu.Game.Tournament.Screens.MapPool setNextMode(); } + [Resolved] + private TournamentSceneManager sceneManager { get; set; } + + private ScheduledDelegate scheduledChange; + private void addForBeatmap(int beatmapId) { if (currentMatch.Value == null) @@ -186,6 +193,12 @@ namespace osu.Game.Tournament.Screens.MapPool }); setNextMode(); + + if (pickType == ChoiceType.Pick) + { + scheduledChange?.Cancel(); + scheduledChange = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(GameplayScreen)); }, 10000); + } } private void matchChanged(MatchPairing match)