From 2d1afb66fb2d9c86b7bae7b930ee65710fe5508b Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 7 Feb 2020 16:21:47 +0300 Subject: [PATCH 1/7] Add history counts to user api --- osu.Game/Users/User.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 5d0ffd5a67..c573fdd089 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -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; /// From 59cf2037d062b7af68e7ea912a5a5715d1016d5a Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Fri, 7 Feb 2020 21:11:58 +0100 Subject: [PATCH 2/7] Introduce SortedStatistics --- osu.Game/Scoring/ScoreInfo.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Scoring/ScoreInfo.cs b/osu.Game/Scoring/ScoreInfo.cs index bed9104cad..a40f436a6e 100644 --- a/osu.Game/Scoring/ScoreInfo.cs +++ b/osu.Game/Scoring/ScoreInfo.cs @@ -151,6 +151,8 @@ namespace osu.Game.Scoring [JsonProperty("statistics")] public Dictionary Statistics = new Dictionary(); + public IOrderedEnumerable> SortedStatistics => Statistics.OrderByDescending(pair => pair.Key); + [JsonIgnore] [Column("Statistics")] public string StatisticsJson From 2770fb71b251fa315be1af4a83b1993ba5838e55 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Fri, 7 Feb 2020 21:12:21 +0100 Subject: [PATCH 3/7] Use SortedStatistics where needed --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 4 ++-- .../Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs | 4 +--- osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index 7a17412722..758140a12d 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -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 { diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index 8a17fef367..6c9f0b0321 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -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; } } diff --git a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs index 43234c0b29..0aab067de1 100644 --- a/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs +++ b/osu.Game/Screens/Ranking/Pages/ScoreResultsPage.cs @@ -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() From 8c10d31af947d8ace2265952bfa2bbbea62e2d43 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Fri, 7 Feb 2020 22:09:45 +0100 Subject: [PATCH 4/7] Make accuracy formatting more consistent --- osu.Game/Utils/FormatUtils.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Utils/FormatUtils.cs b/osu.Game/Utils/FormatUtils.cs index b3758b3375..f2ab99f4b7 100644 --- a/osu.Game/Utils/FormatUtils.cs +++ b/osu.Game/Utils/FormatUtils.cs @@ -7,18 +7,16 @@ namespace osu.Game.Utils { /// /// Turns the provided accuracy into a percentage with 2 decimal places. - /// Omits all decimal places when equals 1d. /// /// The accuracy to be formatted /// formatted accuracy in percentage - public static string FormatAccuracy(this double accuracy) => accuracy == 1 ? "100%" : $"{accuracy:0.00%}"; + public static string FormatAccuracy(this double accuracy) => $"{accuracy:0.00%}"; /// /// Turns the provided accuracy into a percentage with 2 decimal places. - /// Omits all decimal places when equals 100m. /// /// The accuracy to be formatted /// formatted accuracy in percentage - public static string FormatAccuracy(this decimal accuracy) => accuracy == 100 ? "100%" : $"{accuracy:0.00}%"; + public static string FormatAccuracy(this decimal accuracy) => $"{accuracy:0.00}%"; } } From 393b566966c5cd8d6be9b765ebd79e8e9280f1fd Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Fri, 7 Feb 2020 22:16:06 +0100 Subject: [PATCH 5/7] Make PercentageCounter use FormatAccuracy --- osu.Game/Graphics/UserInterface/PercentageCounter.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/PercentageCounter.cs b/osu.Game/Graphics/UserInterface/PercentageCounter.cs index 064c663d59..940c9808ce 100644 --- a/osu.Game/Graphics/UserInterface/PercentageCounter.cs +++ b/osu.Game/Graphics/UserInterface/PercentageCounter.cs @@ -3,6 +3,7 @@ using System; using osu.Framework.Allocation; +using osu.Game.Utils; namespace osu.Game.Graphics.UserInterface { @@ -29,10 +30,7 @@ namespace osu.Game.Graphics.UserInterface [BackgroundDependencyLoader] private void load(OsuColour colours) => AccentColour = colours.BlueLighter; - protected override string FormatCount(double count) - { - return $@"{count:P2}"; - } + protected override string FormatCount(double count) => count.FormatAccuracy(); protected override double GetProportionalDuration(double currentValue, double newValue) { From 9bfd3a1a6348e4f7be4ef305bfbec7b2d207f8ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Sat, 8 Feb 2020 00:11:19 +0100 Subject: [PATCH 6/7] Make PercentageBreakInfoLine use FormatAccuracy --- osu.Game/Screens/Play/Break/BreakInfoLine.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Play/Break/BreakInfoLine.cs b/osu.Game/Screens/Play/Break/BreakInfoLine.cs index 70e7b8f297..18aab394f8 100644 --- a/osu.Game/Screens/Play/Break/BreakInfoLine.cs +++ b/osu.Game/Screens/Play/Break/BreakInfoLine.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Utils; namespace osu.Game.Screens.Play.Break { @@ -85,6 +86,6 @@ namespace osu.Game.Screens.Play.Break { } - protected override string Format(double count) => $@"{count:P2}"; + protected override string Format(double count) => count.FormatAccuracy(); } } From e0de60a277c4f9792b889efc1bb44d39e0251f91 Mon Sep 17 00:00:00 2001 From: Joehu Date: Fri, 7 Feb 2020 21:03:33 -0800 Subject: [PATCH 7/7] Update default background dim to 80% to match stable --- osu.Game/Configuration/OsuConfigManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 4155381790..6ae3c7ac64 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -78,7 +78,7 @@ namespace osu.Game.Configuration Set(OsuSetting.MenuParallax, true); // Gameplay - Set(OsuSetting.DimLevel, 0.3, 0, 1, 0.01); + Set(OsuSetting.DimLevel, 0.8, 0, 1, 0.01); Set(OsuSetting.BlurLevel, 0, 0, 1, 0.01); Set(OsuSetting.LightenDuringBreaks, true);