mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 09:22:54 +08:00
Replace "Connected as _" in login form with a UserPanel
This commit is contained in:
parent
4681beab5d
commit
247d8e9b21
@ -33,14 +33,14 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
Id = 3103765,
|
Id = 3103765,
|
||||||
Country = new Country { FlagName = @"JP" },
|
Country = new Country { FlagName = @"JP" },
|
||||||
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/3103765/5b012e13611d5761caa7e24fecb3d3a16e1cf48fc2a3032cfd43dd444af83d82.jpeg"
|
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/3103765/5b012e13611d5761caa7e24fecb3d3a16e1cf48fc2a3032cfd43dd444af83d82.jpeg"
|
||||||
}),
|
}) { Width = 300 },
|
||||||
peppy = new UserPanel(new User
|
peppy = new UserPanel(new User
|
||||||
{
|
{
|
||||||
Username = @"peppy",
|
Username = @"peppy",
|
||||||
Id = 2,
|
Id = 2,
|
||||||
Country = new Country { FlagName = @"AU" },
|
Country = new Country { FlagName = @"AU" },
|
||||||
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/2/08cad88747c235a64fca5f1b770e100f120827ded1ffe3b66bfcd19c940afa65.jpeg"
|
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/2/08cad88747c235a64fca5f1b770e100f120827ded1ffe3b66bfcd19c940afa65.jpeg"
|
||||||
}),
|
}) { Width = 300 },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Settings.Sections.General
|
namespace osu.Game.Overlays.Settings.Sections.General
|
||||||
{
|
{
|
||||||
@ -71,11 +72,12 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case APIState.Online:
|
case APIState.Online:
|
||||||
|
UserPanel p;
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new OsuSpriteText
|
p = new UserPanel(api.LocalUser.Value)
|
||||||
{
|
{
|
||||||
Text = $"Connected as {api.Username}!",
|
RelativeSizeAxes = Axes.X,
|
||||||
},
|
},
|
||||||
new OsuButton
|
new OsuButton
|
||||||
{
|
{
|
||||||
@ -84,6 +86,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
Action = api.Logout
|
Action = api.Logout
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
p.Status.Value = new UserStatusOnline();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@ namespace osu.Game.Users
|
|||||||
|
|
||||||
public UserPanel(User user)
|
public UserPanel(User user)
|
||||||
{
|
{
|
||||||
Width = 300;
|
|
||||||
Height = height;
|
Height = height;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
CornerRadius = 5;
|
CornerRadius = 5;
|
||||||
|
Loading…
Reference in New Issue
Block a user