1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 16:43:00 +08:00

Merge pull request #22340 from EXtremeExploit/groups-modes

Add modes text to groups tooltip
This commit is contained in:
Dean Herbert 2023-01-23 01:10:25 +09:00 committed by GitHub
commit f87bb589a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -89,6 +89,7 @@ namespace osu.Game.Tests.Visual.Online
Groups = new[]
{
new APIUserGroup { Colour = "#EB47D0", ShortName = "DEV", Name = "Developers" },
new APIUserGroup { Colour = "#A347EB", ShortName = "BN", Name = "Beatmap Nominators", Playmodes = new[] { "mania" } },
new APIUserGroup { Colour = "#A347EB", ShortName = "BN", Name = "Beatmap Nominators", Playmodes = new[] { "osu", "taiko" } }
},
ProfileOrder = new[]

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{
public partial class GroupBadge : Container, IHasTooltip
{
public LocalisableString TooltipText { get; }
public LocalisableString TooltipText { get; private set; }
public int TextSize { get; set; } = 12;
@ -78,6 +78,11 @@ namespace osu.Game.Overlays.Profile.Header.Components
icon.Size = new Vector2(TextSize - 1);
})).ToList()
);
var badgeModesList = group.Playmodes.Select(p => rulesets.GetRuleset(p)?.Name).ToList();
string modesDisplay = string.Join(", ", badgeModesList);
TooltipText += $" ({modesDisplay})";
}
}
}