From 3263060f2c90736bacf2dadebbddfaadaacb6f08 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Fri, 4 Jul 2025 09:23:57 +0300 Subject: [PATCH 1/5] Add grouping separator to PP display in user profile overlay --- .../Profile/Sections/Ranks/DrawableProfileScore.cs | 13 ++++++++----- .../Sections/Ranks/DrawableProfileWeightedScore.cs | 5 ++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index 407e9959f0..52e2ad6041 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -4,6 +4,7 @@ using System; using System.Linq; using osu.Framework.Allocation; +using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -268,21 +269,23 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Direction = FillDirection.Horizontal, Children = new[] { - new OsuSpriteText + new SpriteTextWithTooltip { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Font = font, - Text = $"{Score.PP:0}", - Colour = colourProvider.Highlight1 + Text = Score.PP.ToLocalisableString(@"N0"), + TooltipText = Score.PP.ToLocalisableString(@"N"), + Colour = colourProvider.Highlight1, }, - new OsuSpriteText + new SpriteTextWithTooltip { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Font = font.With(size: 12), Text = "pp", - Colour = colourProvider.Light3 + TooltipText = Score.PP.ToLocalisableString(@"N"), + Colour = colourProvider.Light3, } } }; diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileWeightedScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileWeightedScore.cs index 6cfe34ec6f..36b20d0be5 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileWeightedScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileWeightedScore.cs @@ -4,6 +4,7 @@ using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Online.API.Requests.Responses; @@ -44,7 +45,9 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Child = new OsuSpriteText { Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold, italics: true), - Text = Score.PP.HasValue ? $"{Score.PP * weight:0}pp" : string.Empty, + Text = Score.PP.HasValue + ? LocalisableString.Interpolate($"{Score.PP * weight:N0}pp") + : string.Empty, }, } } From 2029404f53571e53f12c3f5f8f73a16a839167ea Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Fri, 4 Jul 2025 10:44:09 +0300 Subject: [PATCH 2/5] Fix incorrect formating used for tooltips --- .../Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index 52e2ad6041..c651390869 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -275,7 +275,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = font, Text = Score.PP.ToLocalisableString(@"N0"), - TooltipText = Score.PP.ToLocalisableString(@"N"), + TooltipText = Score.PP.ToLocalisableString(@"0.###"), Colour = colourProvider.Highlight1, }, new SpriteTextWithTooltip @@ -284,7 +284,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = font.With(size: 12), Text = "pp", - TooltipText = Score.PP.ToLocalisableString(@"N"), + TooltipText = Score.PP.ToLocalisableString(@"0.###"), Colour = colourProvider.Light3, } } From 6da7db50822fb4f00f0b59eb42c10a5c127d9453 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Fri, 4 Jul 2025 10:57:57 +0300 Subject: [PATCH 3/5] Fix tooltips formatting again --- .../Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index c651390869..22156b8904 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -275,7 +275,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = font, Text = Score.PP.ToLocalisableString(@"N0"), - TooltipText = Score.PP.ToLocalisableString(@"0.###"), + TooltipText = Score.PP.ToLocalisableString(@"#,0.###"), Colour = colourProvider.Highlight1, }, new SpriteTextWithTooltip @@ -284,7 +284,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = font.With(size: 12), Text = "pp", - TooltipText = Score.PP.ToLocalisableString(@"0.###"), + TooltipText = Score.PP.ToLocalisableString(@"#,0.###"), Colour = colourProvider.Light3, } } From a1bbbf1ab92ec5aa09f5b5436738d7b729d67204 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Fri, 4 Jul 2025 15:47:50 +0300 Subject: [PATCH 4/5] Lower decimal digits to one --- .../Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index 22156b8904..cd8f412a5b 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -275,7 +275,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = font, Text = Score.PP.ToLocalisableString(@"N0"), - TooltipText = Score.PP.ToLocalisableString(@"#,0.###"), + TooltipText = Score.PP.ToLocalisableString(@"N1"), Colour = colourProvider.Highlight1, }, new SpriteTextWithTooltip @@ -284,7 +284,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = font.With(size: 12), Text = "pp", - TooltipText = Score.PP.ToLocalisableString(@"#,0.###"), + TooltipText = Score.PP.ToLocalisableString(@"N1"), Colour = colourProvider.Light3, } } From c275064dea65740af6fdc5e17558f4d67e7917ac Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Tue, 8 Jul 2025 14:00:20 +0300 Subject: [PATCH 5/5] Add "pp" suffix to tooltip --- .../Profile/Sections/Ranks/DrawableProfileScore.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index cd8f412a5b..247faaeabf 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -263,6 +263,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks }; } + var ppTooltipText = LocalisableString.Interpolate($@"{Score.PP:N1}pp"); + return new FillFlowContainer { AutoSizeAxes = Axes.Both, @@ -275,7 +277,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = font, Text = Score.PP.ToLocalisableString(@"N0"), - TooltipText = Score.PP.ToLocalisableString(@"N1"), + TooltipText = ppTooltipText, Colour = colourProvider.Highlight1, }, new SpriteTextWithTooltip @@ -283,8 +285,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, Font = font.With(size: 12), - Text = "pp", - TooltipText = Score.PP.ToLocalisableString(@"N1"), + Text = @"pp", + TooltipText = ppTooltipText, Colour = colourProvider.Light3, } }