mirror of
https://github.com/ppy/osu
synced 2024-12-18 04:46:09 +00:00
Show user online status in user overlay (#5058)
Show user online status in user overlay
This commit is contained in:
commit
bcee8fe9c3
@ -39,13 +39,27 @@ namespace osu.Game.Tests.Visual.Online
|
||||
header = new ProfileHeader();
|
||||
Add(header);
|
||||
|
||||
AddStep("Show offline dummy", () => header.User.Value = TestSceneUserProfileOverlay.TEST_USER);
|
||||
AddStep("Show test dummy", () => header.User.Value = TestSceneUserProfileOverlay.TEST_USER);
|
||||
|
||||
AddStep("Show null dummy", () => header.User.Value = new User
|
||||
{
|
||||
Username = "Null"
|
||||
});
|
||||
|
||||
AddStep("Show online dummy", () => header.User.Value = new User
|
||||
{
|
||||
Username = "IAmOnline",
|
||||
LastVisit = DateTimeOffset.Now,
|
||||
IsOnline = true,
|
||||
});
|
||||
|
||||
AddStep("Show offline dummy", () => header.User.Value = new User
|
||||
{
|
||||
Username = "IAmOffline",
|
||||
LastVisit = DateTimeOffset.Now,
|
||||
IsOnline = false,
|
||||
});
|
||||
|
||||
addOnlineStep("Show ppy", new User
|
||||
{
|
||||
Username = @"peppy",
|
||||
|
@ -87,7 +87,12 @@ namespace osu.Game.Overlays.Profile.Header
|
||||
|
||||
addSpacer(topLinkContainer);
|
||||
|
||||
if (user.LastVisit.HasValue)
|
||||
if (user.IsOnline)
|
||||
{
|
||||
topLinkContainer.AddText("Currently online");
|
||||
addSpacer(topLinkContainer);
|
||||
}
|
||||
else if (user.LastVisit.HasValue)
|
||||
{
|
||||
topLinkContainer.AddText("Last seen ");
|
||||
topLinkContainer.AddText(new DrawableDate(user.LastVisit.Value), embolden);
|
||||
|
@ -78,6 +78,9 @@ namespace osu.Game.Users
|
||||
[JsonProperty(@"is_active")]
|
||||
public bool Active;
|
||||
|
||||
[JsonProperty(@"is_online")]
|
||||
public bool IsOnline;
|
||||
|
||||
[JsonProperty(@"pm_friends_only")]
|
||||
public bool PMFriendsOnly;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user