From 564b6ebd0c5bf35e830f13dd20dfd65f1e68882f Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Mon, 2 Mar 2026 22:53:09 -0800 Subject: [PATCH] Add tooltips to beatmap info overlay statistics --- osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs index 94aa639274..59b0547d4e 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs @@ -9,6 +9,7 @@ using osu.Framework.Bindables; using osu.Framework.Extensions.LocalisationExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Input.Events; @@ -108,8 +109,14 @@ namespace osu.Game.Overlays.BeatmapSet Margin = new MarginPadding { Top = 5 }, Children = new[] { - nominations = new Statistic(FontAwesome.Solid.ThumbsUp), - plays = new Statistic(FontAwesome.Solid.PlayCircle), + nominations = new Statistic(FontAwesome.Solid.ThumbsUp) + { + TooltipText = BeatmapsetsStrings.ShowStatsNominations, + }, + plays = new Statistic(FontAwesome.Solid.PlayCircle) + { + TooltipText = BeatmapsetsStrings.ShowStatsPlaycount, + }, favourites = new Statistic(FontAwesome.Solid.Heart), }, }, @@ -188,6 +195,7 @@ namespace osu.Game.Overlays.BeatmapSet plays.Value = BeatmapSet?.PlayCount ?? 0; favourites.Value = BeatmapSet?.FavouriteCount ?? 0; + favourites.TooltipText = BeatmapSet?.FavouriteCount > 0 ? BeatmapsetsStrings.ShowStatsFavourites : BeatmapsetsStrings.ShowStatsNoFavourites; updateDifficultyButtons(); } @@ -377,7 +385,7 @@ namespace osu.Game.Overlays.BeatmapSet } } - private partial class Statistic : FillFlowContainer + private partial class Statistic : FillFlowContainer, IHasTooltip { private readonly OsuSpriteText text; @@ -417,6 +425,8 @@ namespace osu.Game.Overlays.BeatmapSet }, }; } + + public LocalisableString TooltipText { get; set; } } public enum DifficultySelectorState