From ea875101390707763c4928ea49a08aad415c63a9 Mon Sep 17 00:00:00 2001 From: Zihad Date: Fri, 24 Apr 2026 13:55:40 +0600 Subject: [PATCH] Persist last queued pool in ranked play screen (#37490) Closes #37443 Previously it would select the first pool that matches the user's current ruleset. At first I tried passing the `MatchmakingPool` object to the notification and have it passed back to the screen, but with that method only clicking the notification would show the correct pool, if you enter ranked play normally then it would show the "default" pool instead. This method needed fewer changes too. --- .../OnlinePlay/Matchmaking/Queue/QueueController.cs | 12 ++++++------ .../OnlinePlay/Matchmaking/Queue/ScreenQueue.cs | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs index c38f32746e..939b24fa67 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/QueueController.cs @@ -40,7 +40,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue private BackgroundQueueNotification? backgroundNotification; private bool isBackgrounded; - private MatchmakingPool? lastJoinedPool; + public MatchmakingPool? LastJoinedPool { get; private set; } protected override void LoadComplete() { @@ -60,7 +60,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue public void JoinQueue(MatchmakingPool pool) { client.MatchmakingJoinQueue(pool.Id).FireAndForget(); - lastJoinedPool = pool; + LastJoinedPool = pool; } /// @@ -76,8 +76,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue /// public void RejoinQueue() { - if (lastJoinedPool != null) - JoinQueue(lastJoinedPool); + if (LastJoinedPool != null) + JoinQueue(LastJoinedPool); } /// @@ -151,8 +151,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue if (backgroundNotification != null) return; - Debug.Assert(lastJoinedPool != null); - notifications?.Post(backgroundNotification = new BackgroundQueueNotification(this, lastJoinedPool.Type)); + Debug.Assert(LastJoinedPool != null); + notifications?.Post(backgroundNotification = new BackgroundQueueNotification(this, LastJoinedPool.Type)); } private void closeNotifications() diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs index 73eafecc80..827e5f7a92 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Queue/ScreenQueue.cs @@ -345,8 +345,9 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue { availablePools.Value = pools; - // Default to the user's ruleset for the initial pool selection. - selectedPool.Value = pools.FirstOrDefault(p => p.RulesetId == ruleset.Value.OnlineID) ?? pools.FirstOrDefault(); + // Default to the currently queueing pool, or fallback to the user's ruleset for the initial pool selection. + MatchmakingPool? lastQueuedPool = pools.FirstOrDefault(p => p.Id == queue.LastJoinedPool?.Id); + selectedPool.Value = lastQueuedPool ?? pools.FirstOrDefault(p => p.RulesetId == ruleset.Value.OnlineID) ?? pools.FirstOrDefault(); }); }