mirror of
https://github.com/ppy/osu
synced 2025-01-21 05:20:50 +00:00
Move checking logic out of ScoreTable
This commit is contained in:
parent
d71b516902
commit
f661806513
@ -29,7 +29,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
private readonly FillFlowContainer backgroundFlow;
|
||||
|
||||
private Color4 highAccuracyColour;
|
||||
private bool isBeatmapRanked;
|
||||
|
||||
public ScoreTable()
|
||||
{
|
||||
@ -67,13 +66,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
for (int i = 0; i < value.Count; i++)
|
||||
backgroundFlow.Add(new ScoreTableRowBackground(i, value[i], row_height));
|
||||
|
||||
isBeatmapRanked = value.First().Beatmap.Status == BeatmapSetOnlineStatus.Ranked;
|
||||
|
||||
Columns = createHeaders(value.First());
|
||||
Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsBeatmapRanked { get; set; }
|
||||
|
||||
private TableColumn[] createHeaders(ScoreInfo score)
|
||||
{
|
||||
var columns = new List<TableColumn>
|
||||
@ -92,7 +91,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
|
||||
columns.Add(new TableColumn(score.SortedStatistics.LastOrDefault().Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 45, maxSize: 95)));
|
||||
|
||||
if (isBeatmapRanked)
|
||||
if (IsBeatmapRanked)
|
||||
columns.Add(new TableColumn("pp", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 30)));
|
||||
|
||||
columns.Add(new TableColumn("mods", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)));
|
||||
@ -153,7 +152,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
});
|
||||
}
|
||||
|
||||
if (isBeatmapRanked)
|
||||
if (IsBeatmapRanked)
|
||||
{
|
||||
content.Add(new OsuSpriteText
|
||||
{
|
||||
|
@ -59,11 +59,12 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
||||
}
|
||||
|
||||
var scoreInfos = value.Scores.Select(s => s.CreateScoreInfo(rulesets)).ToList();
|
||||
var topScore = scoreInfos.First();
|
||||
|
||||
scoreTable.Scores = scoreInfos;
|
||||
scoreTable.IsBeatmapRanked = topScore.Beatmap.Status == BeatmapSetOnlineStatus.Ranked;
|
||||
scoreTable.Show();
|
||||
|
||||
var topScore = scoreInfos.First();
|
||||
var userScore = value.UserScore;
|
||||
var userScoreInfo = userScore?.Score.CreateScoreInfo(rulesets);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user