1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 03:25:11 +08:00

Merge branch 'master' into fix-accuracy-format

This commit is contained in:
Dean Herbert 2020-02-08 11:37:03 +09:00 committed by GitHub
commit 84d9e3eda7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 6 deletions

View File

@ -82,7 +82,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 90))
};
foreach (var statistic in score.Statistics)
foreach (var statistic in score.SortedStatistics)
columns.Add(new TableColumn(statistic.Key.GetDescription(), Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 50, maxSize: 70)));
columns.AddRange(new[]
@ -150,7 +150,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
}
});
foreach (var kvp in score.Statistics)
foreach (var kvp in score.SortedStatistics)
{
content.Add(new OsuSpriteText
{

View File

@ -99,9 +99,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
maxComboColumn.Text = $@"{value.MaxCombo:N0}x";
ppColumn.Text = $@"{value.PP:N0}";
statisticsColumns.ChildrenEnumerable = value.Statistics
.OrderByDescending(pair => pair.Key)
.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value));
statisticsColumns.ChildrenEnumerable = value.SortedStatistics.Select(kvp => createStatisticsColumn(kvp.Key, kvp.Value));
modsColumn.Mods = value.Mods;
}
}

View File

@ -151,6 +151,8 @@ namespace osu.Game.Scoring
[JsonProperty("statistics")]
public Dictionary<HitResult, int> Statistics = new Dictionary<HitResult, int>();
public IOrderedEnumerable<KeyValuePair<HitResult, int>> SortedStatistics => Statistics.OrderByDescending(pair => pair.Key);
[JsonIgnore]
[Column("Statistics")]
public string StatisticsJson

View File

@ -188,7 +188,7 @@ namespace osu.Game.Screens.Ranking.Pages
},
};
statisticsContainer.ChildrenEnumerable = Score.Statistics.OrderByDescending(p => p.Key).Select(s => new DrawableScoreStatistic(s));
statisticsContainer.ChildrenEnumerable = Score.SortedStatistics.Select(s => new DrawableScoreStatistic(s));
}
protected override void LoadComplete()

View File

@ -203,6 +203,21 @@ namespace osu.Game.Users
public int ID;
}
[JsonProperty("monthly_playcounts")]
public UserHistoryCount[] MonthlyPlaycounts;
[JsonProperty("replays_watched_counts")]
public UserHistoryCount[] ReplaysWatchedCounts;
public class UserHistoryCount
{
[JsonProperty("start_date")]
public DateTime Date;
[JsonProperty("count")]
public long Count;
}
public override string ToString() => Username;
/// <summary>