Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix daily challenge stats display suffix not displayed #29405

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
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;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Scoring;

namespace osu.Game.Overlays.Profile.Header.Components
Expand Down Expand Up @@ -106,7 +106,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($"{stats.PlayCount.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
Comment on lines +115 to +116
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is ever getting fixed 😅

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");
Comment on lines -118 to +120
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add concrete localisations for these instead imo. Duplicate the osu!web ones for our purpose.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to apply that.

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
Loading