-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add user card with global/country ranks to login overlay #26340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
5eaf5fc
c4be6fa
3df7430
7262fef
b86c883
e3989c8
fe06402
66c7a29
353df2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,8 @@ | |
using osu.Game.Online.Multiplayer; | ||
using osu.Game.Screens; | ||
using osu.Game.Screens.Play; | ||
using osu.Game.Users.Drawables; | ||
using osuTK; | ||
|
||
namespace osu.Game.Users | ||
{ | ||
|
@@ -77,23 +79,18 @@ private void load() | |
{ | ||
Masking = true; | ||
|
||
AddRange(new[] | ||
Add(new Box | ||
{ | ||
new Box | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
Colour = ColourProvider?.Background5 ?? Colours.Gray1 | ||
}, | ||
Background = new UserCoverBackground | ||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
User = User, | ||
}, | ||
CreateLayout() | ||
RelativeSizeAxes = Axes.Both, | ||
Colour = ColourProvider?.Background5 ?? Colours.Gray1 | ||
}); | ||
|
||
var background = CreateBackground(); | ||
if (background != null) | ||
Add(background); | ||
|
||
Add(CreateLayout()); | ||
|
||
base.Action = ViewProfile = () => | ||
{ | ||
Action?.Invoke(); | ||
|
@@ -103,13 +100,32 @@ private void load() | |
|
||
protected abstract Drawable CreateLayout(); | ||
|
||
/// <summary> | ||
/// Panel background container. Can be null if a panel doesn't want a background under it's layout | ||
/// </summary> | ||
protected virtual Drawable? CreateBackground() => Background = new UserCoverBackground | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is so weird. So there's one method called At very least this needs xmldoc. Optimally, they shouldn't use the same naming structure. |
||
{ | ||
RelativeSizeAxes = Axes.Both, | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
User = User | ||
}; | ||
|
||
protected OsuSpriteText CreateUsername() => new OsuSpriteText | ||
{ | ||
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Bold), | ||
Shadow = false, | ||
Text = User.Username, | ||
}; | ||
|
||
protected UpdateableAvatar CreateAvatar() => new UpdateableAvatar(User, false); | ||
|
||
protected UpdateableFlag CreateFlag() => new UpdateableFlag(User.CountryCode) | ||
{ | ||
Size = new Vector2(36, 26), | ||
Action = Action, | ||
}; | ||
|
||
public MenuItem[] ContextMenuItems | ||
{ | ||
get | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'll fix this, but note that as you didn't create a local bindable this could cause a bindable leak. only saved by the fact there's only ever one
LoginPanel
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha, will keep in mind