Skip to content

Commit

Permalink
Fix daily challenge stats display suffix not displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzibyte committed Aug 13, 2024
1 parent 5060154 commit 770e363
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
Expand Down Expand Up @@ -106,7 +107,9 @@ private void updateDisplay()

APIUserDailyChallengeStatistics stats = User.Value.User.DailyChallengeStatistics;

dailyPlayCount.Text = UsersStrings.ShowDailyChallengeUnitDay(stats.PlayCount.ToLocalisableString("N0"));
// todo: ideally we want to use UsersStrings.ShowDailyChallengeUnit{Day,Week}(...), but it's broken right now.
// see: https://github.com/ppy/osu/issues/29355#issuecomment-2277139889
dailyPlayCount.Text = LocalisableString.Interpolate($"{1234.ToLocalisableString("N0")}d");
dailyPlayCount.Colour = colours.ForRankingTier(tierForPlayCount(stats.PlayCount));

TooltipContent = new DailyChallengeTooltipData(colourProvider, stats);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,18 @@ public void SetContent(DailyChallengeTooltipData content)
background.Colour = colourProvider.Background4;
topBackground.Colour = colourProvider.Background5;

currentDaily.Value = UsersStrings.ShowDailyChallengeUnitDay(content.Statistics.DailyStreakCurrent.ToLocalisableString(@"N0"));
// todo: ideally we want to use UsersStrings.ShowDailyChallengeUnit{Day,Week}(...), but it's broken right now.
// see: https://github.com/ppy/osu/issues/29355#issuecomment-2277139889
currentDaily.Value = LocalisableString.Interpolate($"{statistics.DailyStreakCurrent.ToLocalisableString("N0")}d");
currentDaily.ValueColour = colours.ForRankingTier(TierForDaily(statistics.DailyStreakCurrent));

currentWeekly.Value = UsersStrings.ShowDailyChallengeUnitWeek(statistics.WeeklyStreakCurrent.ToLocalisableString(@"N0"));
currentWeekly.Value = LocalisableString.Interpolate($"{statistics.WeeklyStreakCurrent.ToLocalisableString(@"N0")}w");
currentWeekly.ValueColour = colours.ForRankingTier(TierForWeekly(statistics.WeeklyStreakCurrent));

bestDaily.Value = UsersStrings.ShowDailyChallengeUnitDay(statistics.DailyStreakBest.ToLocalisableString(@"N0"));
bestDaily.Value = LocalisableString.Interpolate($"{statistics.DailyStreakBest.ToLocalisableString(@"N0")}d");
bestDaily.ValueColour = colours.ForRankingTier(TierForDaily(statistics.DailyStreakBest));

bestWeekly.Value = UsersStrings.ShowDailyChallengeUnitWeek(statistics.WeeklyStreakBest.ToLocalisableString(@"N0"));
bestWeekly.Value = LocalisableString.Interpolate($"{statistics.WeeklyStreakBest.ToLocalisableString(@"N0")}w");
bestWeekly.ValueColour = colours.ForRankingTier(TierForWeekly(statistics.WeeklyStreakBest));

topTen.Value = statistics.Top10PercentPlacements.ToLocalisableString(@"N0");
Expand Down

0 comments on commit 770e363

Please sign in to comment.