mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Basic member of profile header.
This commit is contained in:
@ -1,21 +1,87 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using OpenTK;
|
||||||
using System.Collections.Generic;
|
using OpenTK.Graphics;
|
||||||
using System.Linq;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using System.Text;
|
using osu.Framework.Graphics;
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
|
||||||
namespace osu.Game.Users.Profile
|
namespace osu.Game.Users.Profile
|
||||||
{
|
{
|
||||||
public class UserPageHeader : Container
|
public class UserPageHeader : Container
|
||||||
{
|
{
|
||||||
private readonly User user;
|
private readonly User user;
|
||||||
|
|
||||||
|
private const float cover_height = 200, avatar_size = 110, avatar_bottom_position = -20;
|
||||||
public UserPageHeader(User user)
|
public UserPageHeader(User user)
|
||||||
{
|
{
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
Height = cover_height;
|
||||||
|
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = cover_height,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new AsyncLoadWrapper(new UserCoverBackground(user)
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
FillMode = FillMode.Fill,
|
||||||
|
OnLoadComplete = d => d.FadeInFromZero(200)
|
||||||
|
}) { RelativeSizeAxes = Axes.Both },
|
||||||
|
new UpdateableAvatar
|
||||||
|
{
|
||||||
|
User = user,
|
||||||
|
Size = new Vector2(avatar_size),
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
X = UserProfile.CONTENT_X_MARGIN,
|
||||||
|
Y = avatar_bottom_position,
|
||||||
|
Masking = true,
|
||||||
|
CornerRadius = 5,
|
||||||
|
EdgeEffect = new EdgeEffect
|
||||||
|
{
|
||||||
|
Type = EdgeEffectType.Shadow,
|
||||||
|
Colour = Color4.Black.Opacity(0.25f),
|
||||||
|
Radius = 4,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Origin = Anchor.BottomLeft,
|
||||||
|
X = UserProfile.CONTENT_X_MARGIN + avatar_size + 10,
|
||||||
|
Y = avatar_bottom_position,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuSpriteText
|
||||||
|
{
|
||||||
|
Text = user.Username,
|
||||||
|
TextSize = 25,
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -18,6 +13,9 @@ namespace osu.Game.Users
|
|||||||
{
|
{
|
||||||
private readonly User user;
|
private readonly User user;
|
||||||
private ProfileSection lastSection;
|
private ProfileSection lastSection;
|
||||||
|
|
||||||
|
public const float CONTENT_X_MARGIN = 50;
|
||||||
|
|
||||||
public UserProfile(User user)
|
public UserProfile(User user)
|
||||||
{
|
{
|
||||||
this.user = user;
|
this.user = user;
|
||||||
|
Reference in New Issue
Block a user