From 53c968e137488ba4719f5241d0edb3d32940ece3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 11 Nov 2020 10:19:59 +0900 Subject: [PATCH] Fix user profile best performance weighting being out of order --- .../Profile/Sections/Ranks/PaginatedScoreContainer.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index 3c540d6fbb..1ce3079d52 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -46,6 +46,9 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks protected override void OnItemsReceived(List 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> 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++)); } } }