mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 20:42:54 +08:00
Update to use localiastions
This commit is contained in:
parent
d9c965c47b
commit
d76fc34cf8
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Extensions.LocalisationExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Cursor;
|
using osu.Framework.Graphics.Cursor;
|
||||||
@ -10,6 +11,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Resources.Localisation.Web;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Profile.Header.Components
|
namespace osu.Game.Overlays.Profile.Header.Components
|
||||||
{
|
{
|
||||||
@ -50,8 +52,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
new OsuTextFlowContainer(s => s.Font = OsuFont.GetFont(size: 12))
|
new OsuTextFlowContainer(s => s.Font = OsuFont.GetFont(size: 12))
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
// Text = UsersStrings.ShowDailyChallengeTitle
|
Text = UsersStrings.ShowDailyChallengeTitle,
|
||||||
Text = "Daily\nChallenge",
|
|
||||||
Margin = new MarginPadding { Horizontal = 5f, Bottom = 2f },
|
Margin = new MarginPadding { Horizontal = 5f, Bottom = 2f },
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
@ -97,9 +98,8 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
var statistics = User.Value.User.DailyChallengeStatistics;
|
var statistics = User.Value.User.DailyChallengeStatistics;
|
||||||
// dailyStreak.Text = UsersStrings.ShowDailyChallengeUnitDay(statistics.PlayCount);
|
dailyStreak.Text = UsersStrings.ShowDailyChallengeUnitDay(statistics.PlayCount.ToLocalisableString("N0"));
|
||||||
dailyStreak.Text = $"{statistics.PlayCount}d";
|
TooltipContent = new DailyChallengeTooltipData(colourProvider, statistics);
|
||||||
TooltipContent = new DailyChallengeStreakTooltipData(colourProvider, statistics);
|
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ using osu.Framework.Localisation;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
using osu.Game.Resources.Localisation.Web;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using Box = osu.Framework.Graphics.Shapes.Box;
|
using Box = osu.Framework.Graphics.Shapes.Box;
|
||||||
@ -78,10 +79,8 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
Spacing = new Vector2(30f),
|
Spacing = new Vector2(30f),
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
// currentDaily = new StreakPiece(UsersStrings.ShowDailyChallengeDailyStreakCurrent),
|
currentDaily = new StreakPiece(UsersStrings.ShowDailyChallengeDailyStreakCurrent),
|
||||||
// currentWeekly = new StreakPiece(UsersStrings.ShowDailyChallengeWeeklyStreakCurrent),
|
currentWeekly = new StreakPiece(UsersStrings.ShowDailyChallengeWeeklyStreakCurrent),
|
||||||
currentDaily = new StreakPiece("Current Daily Streak"),
|
|
||||||
currentWeekly = new StreakPiece("Current Weekly Streak"),
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -94,14 +93,10 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
Spacing = new Vector2(10f),
|
Spacing = new Vector2(10f),
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
// bestDaily = new StatisticsPiece(UsersStrings.ShowDailyChallengeDailyStreakBest),
|
bestDaily = new StatisticsPiece(UsersStrings.ShowDailyChallengeDailyStreakBest),
|
||||||
// bestWeekly = new StatisticsPiece(UsersStrings.ShowDailyChallengeWeeklyStreakBest),
|
bestWeekly = new StatisticsPiece(UsersStrings.ShowDailyChallengeWeeklyStreakBest),
|
||||||
// topTen = new StatisticsPiece(UsersStrings.ShowDailyChallengeTop10pPlacements),
|
topTen = new StatisticsPiece(UsersStrings.ShowDailyChallengeTop10pPlacements),
|
||||||
// topFifty = new StatisticsPiece(UsersStrings.ShowDailyChallengeTop50pPlacements),
|
topFifty = new StatisticsPiece(UsersStrings.ShowDailyChallengeTop50pPlacements),
|
||||||
bestDaily = new StatisticsPiece("Best Daily Streak"),
|
|
||||||
bestWeekly = new StatisticsPiece("Best Weekly Streak"),
|
|
||||||
topTen = new StatisticsPiece("Top 10% Placements"),
|
|
||||||
topFifty = new StatisticsPiece("Top 50% Placements"),
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -117,20 +112,16 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
background.Colour = colourProvider.Background4;
|
background.Colour = colourProvider.Background4;
|
||||||
topBackground.Colour = colourProvider.Background5;
|
topBackground.Colour = colourProvider.Background5;
|
||||||
|
|
||||||
// currentDaily.Value = UsersStrings.ShowDailyChallengeUnitDay(content.DailyStreakCurrent.ToLocalisableString(@"N0"));
|
currentDaily.Value = UsersStrings.ShowDailyChallengeUnitDay(content.Statistics.DailyStreakCurrent.ToLocalisableString(@"N0"));
|
||||||
currentDaily.Value = $"{statistics.DailyStreakCurrent:N0}d";
|
|
||||||
currentDaily.ValueColour = colours.ForRankingTier(TierForDaily(statistics.DailyStreakCurrent));
|
currentDaily.ValueColour = colours.ForRankingTier(TierForDaily(statistics.DailyStreakCurrent));
|
||||||
|
|
||||||
// currentWeekly.Value = UsersStrings.ShowDailyChallengeUnitWeek(statistics.WeeklyStreakCurrent.ToLocalisableString(@"N0"));
|
currentWeekly.Value = UsersStrings.ShowDailyChallengeUnitWeek(statistics.WeeklyStreakCurrent.ToLocalisableString(@"N0"));
|
||||||
currentWeekly.Value = $"{statistics.WeeklyStreakCurrent:N0}w";
|
|
||||||
currentWeekly.ValueColour = colours.ForRankingTier(TierForWeekly(statistics.WeeklyStreakCurrent));
|
currentWeekly.ValueColour = colours.ForRankingTier(TierForWeekly(statistics.WeeklyStreakCurrent));
|
||||||
|
|
||||||
// bestDaily.Value = UsersStrings.ShowDailyChallengeUnitDay(statistics.DailyStreakBest.ToLocalisableString(@"N0"));
|
bestDaily.Value = UsersStrings.ShowDailyChallengeUnitDay(statistics.DailyStreakBest.ToLocalisableString(@"N0"));
|
||||||
bestDaily.Value = $"{statistics.DailyStreakBest:N0}d";
|
|
||||||
bestDaily.ValueColour = colours.ForRankingTier(TierForDaily(statistics.DailyStreakBest));
|
bestDaily.ValueColour = colours.ForRankingTier(TierForDaily(statistics.DailyStreakBest));
|
||||||
|
|
||||||
// bestWeekly.Value = UsersStrings.ShowDailyChallengeUnitWeek(statistics.WeeklyStreakBest.ToLocalisableString(@"N0"));
|
bestWeekly.Value = UsersStrings.ShowDailyChallengeUnitWeek(statistics.WeeklyStreakBest.ToLocalisableString(@"N0"));
|
||||||
bestWeekly.Value = $"{statistics.WeeklyStreakBest:N0}w";
|
|
||||||
bestWeekly.ValueColour = colours.ForRankingTier(TierForWeekly(statistics.WeeklyStreakBest));
|
bestWeekly.ValueColour = colours.ForRankingTier(TierForWeekly(statistics.WeeklyStreakBest));
|
||||||
|
|
||||||
topTen.Value = statistics.Top10PercentPlacements.ToLocalisableString(@"N0");
|
topTen.Value = statistics.Top10PercentPlacements.ToLocalisableString(@"N0");
|
||||||
|
Loading…
Reference in New Issue
Block a user