From 2e324fe856bd6a9c7f12c0e2aa00a580a104980c Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Mon, 29 Dec 2025 17:45:31 +0900 Subject: [PATCH] Show vote count in tag tooltip --- osu.Game/Online/API/Requests/Responses/APIBeatmap.cs | 4 ++-- osu.Game/Overlays/BeatmapSet/Info.cs | 2 +- .../MatchmakingSelectPanel.CardContentBeatmap.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs index 6fd8416270..3a0afcd0ab 100644 --- a/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs +++ b/osu.Game/Online/API/Requests/Responses/APIBeatmap.cs @@ -117,7 +117,7 @@ namespace osu.Game.Online.API.Requests.Responses [JsonProperty(@"owners")] public BeatmapOwner[] BeatmapOwners { get; set; } = Array.Empty(); - public APITag[] GetTopUserTags() + public (APITag Tag, int VoteCount)[] GetTopUserTags() { if (TopTags == null || TopTags.Length == 0 || BeatmapSet?.RelatedTags == null) return []; @@ -130,7 +130,7 @@ namespace osu.Game.Online.API.Requests.Responses // see https://github.com/ppy/osu-web/blob/bb3bd2e7c6f84f26066df5ea20a81c77ec9bb60a/resources/js/beatmapsets-show/controller.ts#L103-L106 for sort criteria .OrderByDescending(t => t.topTag.VoteCount) .ThenBy(t => t.relatedTag!.Name) - .Select(t => t.relatedTag!) + .Select(t => (t.relatedTag!, t.topTag.VoteCount)) .ToArray(); } diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index f7e3fa93c5..9a21995234 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -129,7 +129,7 @@ namespace osu.Game.Overlays.BeatmapSet private void updateUserTags() { - userTags.Metadata = Beatmap.Value.GetTopUserTags().Select(t => t.Name).ToArray(); + userTags.Metadata = Beatmap.Value.GetTopUserTags().Select(t => t.Tag.Name).ToArray(); } [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanel.CardContentBeatmap.cs b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanel.CardContentBeatmap.cs index 8a5d81c018..e2d5fa7890 100644 --- a/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanel.CardContentBeatmap.cs +++ b/osu.Game/Screens/OnlinePlay/Matchmaking/Match/BeatmapSelect/MatchmakingSelectPanel.CardContentBeatmap.cs @@ -458,7 +458,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect new OsuSpriteText { Padding = new MarginPadding { Vertical = 3, Horizontal = 8 }, - Text = beatmap.GetTopUserTags().FirstOrDefault()?.Name ?? string.Empty, + Text = beatmap.GetTopUserTags().FirstOrDefault().Tag?.Name ?? string.Empty, AlwaysPresent = true, Colour = colourProvider.Content2, Font = OsuFont.Style.Caption2, @@ -468,7 +468,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match.BeatmapSelect }; } - public LocalisableString TooltipText => string.Join('\n', beatmap.GetTopUserTags().Select(t => t.Name)); + public LocalisableString TooltipText => string.Join('\n', beatmap.GetTopUserTags().Select(t => $"{t.Tag.Name} ({t.VoteCount})")); } } }