From b1270a84f8a3f377a8dfea174714154144826640 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Fri, 8 Dec 2017 11:31:32 +0100 Subject: [PATCH] Added handling for rank == 0 (unranked), removed "#0" from country name if that happens, also display "no rank" when hovering over history instead of "#0" --- osu.Game/Overlays/Profile/RankChart.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/RankChart.cs b/osu.Game/Overlays/Profile/RankChart.cs index 5bd6d30b42..8190ef3c62 100644 --- a/osu.Game/Overlays/Profile/RankChart.cs +++ b/osu.Game/Overlays/Profile/RankChart.cs @@ -81,12 +81,12 @@ namespace osu.Game.Overlays.Profile { rankText.Text = user.Statistics.Rank > 0 ? $"#{user.Statistics.Rank:#,0}" : "no rank"; performanceText.Text = user.Statistics.PP != null ? $"{user.Statistics.PP:#,0}pp" : string.Empty; - relativeText.Text = $"{user.Country?.FullName} #{user.CountryRank:#,0}"; + relativeText.Text = user.CountryRank > 0 ? $"{user.Country?.FullName} #{user.CountryRank:#,0}" : $"{user.Country?.FullName}"; } private void showHistoryRankTexts(int dayIndex) { - rankText.Text = $"#{ranks[dayIndex]:#,0}"; + rankText.Text = ranks[dayIndex] > 0 ? $"#{ranks[dayIndex]:#,0}" : "no rank"; dayIndex++; relativeText.Text = dayIndex == ranks.Length ? "Now" : $"{ranks.Length - dayIndex} days ago"; //plural should be handled in a general way @@ -99,7 +99,7 @@ namespace osu.Game.Overlays.Profile { graph.Colour = colours.Yellow; // use logarithmic coordinates - graph.Values = ranks.Select(x => -(float)Math.Log(x)); + graph.Values = ranks.Select(x => x == 0 ? float.MinValue : -(float)Math.Log(x)); graph.SetStaticBallPosition(); }