Update some container structure.

This commit is contained in:
Huo Yaoyuan 2017-06-16 15:01:09 +08:00
parent fa98cfa9e5
commit a08d35ec4c

View File

@ -28,7 +28,7 @@ namespace osu.Game.Users.Profile
private readonly SpriteText levelText; private readonly SpriteText levelText;
private readonly GradeBadge gradeSSPlus, gradeSS, gradeSPlus, gradeS, gradeA; private readonly GradeBadge gradeSSPlus, gradeSS, gradeSPlus, gradeS, gradeA;
private const float cover_height = 350, info_height = 150, info_width = 250, avatar_size = 110, avatar_bottom_position = -20, level_position = 30, level_height = 60; private const float cover_height = 350, info_height = 150, info_width = 250, avatar_size = 110, level_position = 30, level_height = 60;
public ProfileHeader(User user) public ProfileHeader(User user)
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
@ -47,49 +47,58 @@ namespace osu.Game.Users.Profile
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
ColourInfo = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f)) ColourInfo = ColourInfo.GradientVertical(Color4.Black.Opacity(0.1f), Color4.Black.Opacity(0.75f))
}, },
new UpdateableAvatar
{
User = user,
Size = new Vector2(avatar_size),
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
X = UserProfileOverlay.CONTENT_X_MARGIN,
Y = avatar_bottom_position,
Masking = true,
CornerRadius = 5,
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f),
Radius = 4,
},
},
new Container new Container
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
X = UserProfileOverlay.CONTENT_X_MARGIN + avatar_size + 10, X = UserProfileOverlay.CONTENT_X_MARGIN,
Y = avatar_bottom_position, Y = -20,
AutoSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new UpdateableAvatar
{ {
Text = user.Username, User = user,
TextSize = 30, Size = new Vector2(avatar_size),
Font = @"Exo2.0-RegularItalic",
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Y = -55 Masking = true,
CornerRadius = 5,
EdgeEffect = new EdgeEffectParameters
{
Type = EdgeEffectType.Shadow,
Colour = Color4.Black.Opacity(0.25f),
Radius = 4,
},
}, },
new DrawableFlag(user.Country?.FlagName ?? "__") new Container
{ {
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Width = 30, X = avatar_size + 10,
Height = 20 AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
new OsuSpriteText
{
Text = user.Username,
TextSize = 30,
Font = @"Exo2.0-RegularItalic",
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Y = -55
},
new DrawableFlag(user.Country?.FlagName ?? "__")
{
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
Width = 30,
Height = 20
}
}
} }
} }
} },
} }
}, },
infoTextLeft = new OsuTextFlowContainer(t => infoTextLeft = new OsuTextFlowContainer(t =>
@ -108,7 +117,7 @@ namespace osu.Game.Users.Profile
infoTextRight = new OsuTextFlowContainer(t => infoTextRight = new OsuTextFlowContainer(t =>
{ {
t.TextSize = 14; t.TextSize = 14;
t.Alpha = 0.8f; t.Font = @"Exo2.0-RegularItalic";
}) })
{ {
X = UserProfileOverlay.CONTENT_X_MARGIN + info_width + 20, X = UserProfileOverlay.CONTENT_X_MARGIN + info_width + 20,
@ -349,11 +358,7 @@ namespace osu.Game.Users.Profile
{ {
if (string.IsNullOrEmpty(str)) return; if (string.IsNullOrEmpty(str)) return;
infoTextRight.AddTextAwesome(icon); infoTextRight.AddTextAwesome(icon);
infoTextRight.AddText(" " + str, t => infoTextRight.AddText(" " + str);
{
t.Font = @"Exo2.0-RegularItalic";
t.Alpha = 1;
});
infoTextRight.NewLine(); infoTextRight.NewLine();
} }