mirror of
https://github.com/ppy/osu
synced 2025-01-26 15:53:12 +00:00
feat: integrate previous usernames tooltip to profile overlay
This commit is contained in:
parent
200b3f87ff
commit
8c137353b6
@ -110,5 +110,31 @@ namespace osu.Game.Tests.Visual.Online
|
||||
}
|
||||
}, new OsuRuleset().RulesetInfo));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestPreviousUsernames()
|
||||
{
|
||||
AddStep("Show user w/ previous usernames", () => header.User.Value = new UserProfileData(new APIUser
|
||||
{
|
||||
Id = 727,
|
||||
Username = "SomeoneIndecisive",
|
||||
CoverUrl = @"https://osu.ppy.sh/images/headers/profile-covers/c1.jpg",
|
||||
Groups = new[]
|
||||
{
|
||||
new APIUserGroup { Colour = "#EB47D0", ShortName = "DEV", Name = "Developers" },
|
||||
},
|
||||
Statistics = new UserStatistics
|
||||
{
|
||||
IsRanked = false,
|
||||
// web will sometimes return non-empty rank history even for unranked users.
|
||||
RankHistory = new APIRankHistory
|
||||
{
|
||||
Mode = @"osu",
|
||||
Data = Enumerable.Range(2345, 85).ToArray()
|
||||
},
|
||||
},
|
||||
PreviousUsernames = new[] { "tsrk.", "quoicoubeh", "apagnan", "epita" }
|
||||
}, new OsuRuleset().RulesetInfo));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
private OsuSpriteText userCountryText = null!;
|
||||
private GroupBadgeFlow groupBadgeFlow = null!;
|
||||
private ToggleCoverButton coverToggle = null!;
|
||||
private PreviousUsernames previousUsernames = null!;
|
||||
|
||||
private Bindable<bool> coverExpanded = null!;
|
||||
|
||||
@ -143,6 +144,18 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
},
|
||||
new Container
|
||||
{
|
||||
Child = previousUsernames = new PreviousUsernames
|
||||
{
|
||||
Anchor = Anchor.TopLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
},
|
||||
Anchor = Anchor.TopLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
Size = new Vector2(0),
|
||||
Position = new Vector2(10)
|
||||
}
|
||||
}
|
||||
},
|
||||
titleText = new OsuSpriteText
|
||||
@ -216,6 +229,7 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
titleText.Text = user?.Title ?? string.Empty;
|
||||
titleText.Colour = Color4Extensions.FromHex(user?.Colour ?? "fff");
|
||||
groupBadgeFlow.User.Value = user;
|
||||
previousUsernames.User.Value = user;
|
||||
}
|
||||
|
||||
private void updateCoverState()
|
||||
|
Loading…
Reference in New Issue
Block a user