Skip to content

Commit

Permalink
Merge pull request #22340 from EXtremeExploit/groups-modes
Browse files Browse the repository at this point in the history
Add modes text to groups tooltip
  • Loading branch information
peppy authored Jan 22, 2023
2 parents 9a89dfb + e1acf85 commit f87bb58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public void TestLoading()
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[]
Expand Down
7 changes: 6 additions & 1 deletion osu.Game/Overlays/Profile/Header/Components/GroupBadge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -78,6 +78,11 @@ private void load(OverlayColourProvider? colourProvider, RulesetStore rulesets)
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})";
}
}
}
Expand Down

0 comments on commit f87bb58

Please sign in to comment.