1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-25 03:07:34 +08:00

Change score background to pink if user is friended

This commit is contained in:
Plextora 2024-12-22 16:58:00 -05:00
parent 78e9463f63
commit b3056d6114

View File

@ -101,6 +101,7 @@ namespace osu.Game.Online.Leaderboards
private void load(IAPIProvider api, OsuColour colour)
{
var user = Score.User;
bool isUserFriend = api.Friends.Any(friend => friend.TargetID == user.OnlineID);
statisticsLabels = GetStatistics(Score).Select(s => new ScoreComponentLabel(s)).ToList();
@ -129,7 +130,7 @@ namespace osu.Game.Online.Leaderboards
background = new Box
{
RelativeSizeAxes = Axes.Both,
Colour = user.OnlineID == api.LocalUser.Value.Id && isOnlineScope ? colour.Green : Color4.Black,
Colour = isUserFriend ? colour.Pink : (user.OnlineID == api.LocalUser.Value.Id && isOnlineScope ? colour.Green : Color4.Black),
Alpha = background_alpha,
},
},