1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Merge pull request #10784 from peppy/fix-best-performance-weighting

Fix user profile best performance weighting being out of order
This commit is contained in:
Dan Balasescu 2020-11-11 11:21:43 +09:00 committed by GitHub
commit 451f0a29c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,9 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
protected override void OnItemsReceived(List<APILegacyScoreInfo> items)
{
if (VisiblePages == 0)
drawableItemIndex = 0;
base.OnItemsReceived(items);
if (type == ScoreType.Recent)
@ -55,6 +58,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
protected override APIRequest<List<APILegacyScoreInfo>> CreateRequest() =>
new GetUserScoresRequest(User.Value.Id, type, VisiblePages++, ItemsPerPage);
private int drawableItemIndex;
protected override Drawable CreateDrawableItem(APILegacyScoreInfo model)
{
switch (type)
@ -63,7 +68,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
return new DrawableProfileScore(model.CreateScoreInfo(Rulesets));
case ScoreType.Best:
return new DrawableProfileWeightedScore(model.CreateScoreInfo(Rulesets), Math.Pow(0.95, ItemsContainer.Count));
return new DrawableProfileWeightedScore(model.CreateScoreInfo(Rulesets), Math.Pow(0.95, drawableItemIndex++));
}
}
}