mirror of
https://github.com/ppy/osu.git
synced 2026-05-13 20:33:35 +08:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -76,8 +76,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Queue
|
||||
/// </summary>
|
||||
public void RejoinQueue()
|
||||
{
|
||||
if (lastJoinedPool != null)
|
||||
JoinQueue(lastJoinedPool);
|
||||
if (LastJoinedPool != null)
|
||||
JoinQueue(LastJoinedPool);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user