mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 03:20:16 +08:00
Merge pull request #35482 from smoogipoo/qp-fix-initial-placement-display
Ensure to never display "0th" placement
This commit is contained in:
@@ -23,7 +23,7 @@ namespace osu.Game.Online.Multiplayer.MatchTypes.Matchmaking
|
||||
/// The aggregate room placement (1-based).
|
||||
/// </summary>
|
||||
[Key(1)]
|
||||
public int Placement { get; set; }
|
||||
public int? Placement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The aggregate points.
|
||||
|
||||
@@ -414,8 +414,11 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match
|
||||
if (!matchmakingState.Users.UserDictionary.TryGetValue(User.Id, out MatchmakingUser? userScore))
|
||||
return;
|
||||
|
||||
rankText.Text = userScore.Placement.Ordinalize(CultureInfo.CurrentCulture);
|
||||
rankText.FadeColour(SubScreenResults.ColourForPlacement(userScore.Placement));
|
||||
if (userScore.Placement == null)
|
||||
return;
|
||||
|
||||
rankText.Text = userScore.Placement.Value.Ordinalize(CultureInfo.CurrentCulture);
|
||||
rankText.FadeColour(SubScreenResults.ColourForPlacement(userScore.Placement.Value));
|
||||
scoreText.Text = $"{userScore.Points} pts";
|
||||
});
|
||||
|
||||
|
||||
@@ -239,8 +239,8 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match
|
||||
if (client.Room?.MatchState is not MatchmakingRoomState matchmakingState)
|
||||
continue;
|
||||
|
||||
if (matchmakingState.Users.UserDictionary.TryGetValue(panels[i].User.Id, out MatchmakingUser? user))
|
||||
SetLayoutPosition(Children[i], user.Placement);
|
||||
if (matchmakingState.Users.UserDictionary.TryGetValue(panels[i].User.Id, out MatchmakingUser? user) && user.Placement != null)
|
||||
SetLayoutPosition(Children[i], user.Placement.Value);
|
||||
else
|
||||
SetLayoutPosition(Children[i], float.MaxValue);
|
||||
}
|
||||
|
||||
@@ -201,13 +201,16 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.Results
|
||||
return;
|
||||
}
|
||||
|
||||
int overallPlacement = state.Users[client.LocalUser!.UserID].Placement;
|
||||
int? overallPlacement = state.Users[client.LocalUser!.UserID].Placement;
|
||||
|
||||
placementText.Text = overallPlacement.Ordinalize(CultureInfo.CurrentCulture);
|
||||
placementText.Colour = ColourForPlacement(overallPlacement);
|
||||
if (overallPlacement != null)
|
||||
{
|
||||
placementText.Text = overallPlacement.Value.Ordinalize(CultureInfo.CurrentCulture);
|
||||
placementText.Colour = ColourForPlacement(overallPlacement.Value);
|
||||
|
||||
int overallPoints = state.Users[client.LocalUser!.UserID].Points;
|
||||
addStatistic(overallPlacement, $"Overall position ({overallPoints} points)");
|
||||
int overallPoints = state.Users[client.LocalUser!.UserID].Points;
|
||||
addStatistic(overallPlacement.Value, $"Overall position ({overallPoints} points)");
|
||||
}
|
||||
|
||||
var accuracyOrderedUsers = state.Users.Select(u => (user: u, avgAcc: u.Rounds.Select(r => r.Accuracy).DefaultIfEmpty(0).Average()))
|
||||
.OrderByDescending(t => t.avgAcc)
|
||||
|
||||
Reference in New Issue
Block a user