Revert some changes

This commit is contained in:
smoogipoo
2021-08-31 18:56:26 +09:00
parent 90768a86a6
commit bfcadcc4ac
5 changed files with 32 additions and 66 deletions

View File

@ -152,7 +152,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
{
Margin = new MarginPadding { Right = horizontal_inset },
Font = OsuFont.GetFont(size: text_size, weight: index == 0 ? FontWeight.Bold : FontWeight.Medium),
Text = scoreManager.GetTotalScore(score).ToLocalisableString(@"N0"),
Current = scoreManager.GetBindableTotalScoreString(score),
},
new OsuSpriteText
{

View File

@ -15,7 +15,6 @@ using osu.Framework.Bindables;
using osu.Game.Configuration;
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Users;
@ -30,7 +29,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
private readonly Bindable<BeatmapLeaderboardScope> scope = new Bindable<BeatmapLeaderboardScope>(BeatmapLeaderboardScope.Global);
private readonly IBindable<User> user = new Bindable<User>();
private readonly Bindable<ScoringMode> scoringMode = new Bindable<ScoringMode>();
private readonly Box background;
private readonly ScoreTable scoreTable;
@ -51,15 +49,37 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
private GetScoresRequest getScoresRequest;
private APILegacyScores scores;
protected APILegacyScores Scores
{
set
set => Schedule(() =>
{
scores = value;
displayScores(value);
}
topScoresContainer.Clear();
if (value?.Scores.Any() != true)
{
scoreTable.ClearScores();
scoreTable.Hide();
return;
}
var scoreInfos = value.Scores.Select(s => s.CreateScoreInfo(rulesets))
.OrderByDescending(s => scoreManager.GetTotalScore(s))
.ThenBy(s => s.OnlineScoreID)
.ToList();
var topScore = scoreInfos.First();
scoreTable.DisplayScores(scoreInfos, topScore.Beatmap?.Status.GrantsPerformancePoints() == true);
scoreTable.Show();
var userScore = value.UserScore;
var userScoreInfo = userScore?.Score.CreateScoreInfo(rulesets);
topScoresContainer.Add(new DrawableTopScore(topScore));
if (userScoreInfo != null && userScoreInfo.OnlineScoreID != topScore.OnlineScoreID)
topScoresContainer.Add(new DrawableTopScore(userScoreInfo, userScore.Position));
});
}
public ScoresContainer()
@ -160,7 +180,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
background.Colour = colourProvider.Background5;
user.BindTo(api.LocalUser);
config.BindWith(OsuSetting.ScoreDisplayMode, scoringMode);
}
protected override void LoadComplete()
@ -173,8 +192,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
Beatmap.BindValueChanged(onBeatmapChanged);
user.BindValueChanged(onUserChanged, true);
scoringMode.BindValueChanged(_ => displayScores(scores));
}
private void onBeatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
@ -246,39 +263,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
api.Queue(getScoresRequest);
}
private void displayScores(APILegacyScores newScores)
{
Schedule(() =>
{
topScoresContainer.Clear();
if (newScores?.Scores.Any() != true)
{
scoreTable.ClearScores();
scoreTable.Hide();
return;
}
var scoreInfos = newScores.Scores.Select(s => s.CreateScoreInfo(rulesets))
.OrderByDescending(s => scoreManager.GetTotalScore(s))
.ThenBy(s => s.OnlineScoreID)
.ToList();
var topScore = scoreInfos.First();
scoreTable.DisplayScores(scoreInfos, topScore.Beatmap?.Status.GrantsPerformancePoints() == true);
scoreTable.Show();
var userScore = newScores.UserScore;
var userScoreInfo = userScore?.Score.CreateScoreInfo(rulesets);
topScoresContainer.Add(new DrawableTopScore(topScore));
if (userScoreInfo != null && userScoreInfo.OnlineScoreID != topScore.OnlineScoreID)
topScoresContainer.Add(new DrawableTopScore(userScoreInfo, userScore.Position));
});
}
private bool userIsSupporter => api.IsLoggedIn && api.LocalUser.Value.IsSupporter;
}
}