mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:13:18 +08:00
Update Leaderboard to reorder scores based on scoring mode
This commit is contained in:
parent
458ce250f0
commit
4ebb11472d
@ -13,11 +13,13 @@ using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.Placeholders;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -27,6 +29,7 @@ namespace osu.Game.Online.Leaderboards
|
||||
{
|
||||
private const double fade_duration = 300;
|
||||
|
||||
private readonly Bindable<ScoringMode> scoringMode = new Bindable<ScoringMode>();
|
||||
private readonly OsuScrollContainer scrollContainer;
|
||||
private readonly Container placeholderContainer;
|
||||
private readonly UserTopScoreContainer<TScoreInfo> topScoreContainer;
|
||||
@ -246,12 +249,15 @@ namespace osu.Game.Online.Leaderboards
|
||||
private readonly IBindable<APIState> apiState = new Bindable<APIState>();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
private void load(OsuConfigManager configManager)
|
||||
{
|
||||
if (api != null)
|
||||
apiState.BindTo(api.State);
|
||||
|
||||
apiState.BindValueChanged(onlineStateChanged, true);
|
||||
|
||||
configManager.BindWith(OsuSetting.ScoreDisplayMode, scoringMode);
|
||||
scoringMode.BindValueChanged(_ => RefreshScores(), true);
|
||||
}
|
||||
|
||||
private APIRequest getScoresRequest;
|
||||
|
@ -198,8 +198,8 @@ namespace osu.Game.Online.Leaderboards
|
||||
{
|
||||
TextColour = Color4.White,
|
||||
GlowColour = Color4Extensions.FromHex(@"83ccfa"),
|
||||
Current = scoreManager.GetBindableTotalScoreString(score),
|
||||
Font = OsuFont.Numeric.With(size: 23),
|
||||
Text = scoreManager.GetTotalScore(score).ToLocalisableString(@"N0"),
|
||||
},
|
||||
RankContainer = new Container
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
scores = scores.Where(s => s.Mods.Any(m => selectedMods.Contains(m.Acronym)));
|
||||
}
|
||||
|
||||
Scores = scores.OrderByDescending(s => s.TotalScore).ToArray();
|
||||
Scores = scores.OrderByDescending(s => scoreManager.GetTotalScore(s)).ToArray();
|
||||
PlaceholderState = Scores.Any() ? PlaceholderState.Successful : PlaceholderState.NoScores;
|
||||
|
||||
return null;
|
||||
@ -182,7 +182,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
req.Success += r =>
|
||||
{
|
||||
scoresCallback?.Invoke(r.Scores.Select(s => s.CreateScoreInfo(rulesets)));
|
||||
scoresCallback?.Invoke(r.Scores.Select(s => s.CreateScoreInfo(rulesets)).OrderByDescending(s => scoreManager.GetTotalScore(s)));
|
||||
TopScore = r.UserScore?.CreateScoreInfo(rulesets);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user