1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 05:17:25 +08:00
osu-lazer/osu.Game/Overlays/Profile/ProfileSection.cs

80 lines
2.5 KiB
C#
Raw Normal View History

2017-05-25 02:11:07 +08:00
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-06-09 15:22:07 +08:00
using OpenTK;
2017-06-09 14:53:00 +08:00
using osu.Framework.Graphics;
2017-05-25 02:11:07 +08:00
using osu.Framework.Graphics.Containers;
2017-06-21 16:03:47 +08:00
using osu.Framework.Graphics.Shapes;
2017-06-09 14:53:00 +08:00
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
2017-09-14 19:05:43 +08:00
using osu.Game.Users;
2017-07-13 13:24:08 +08:00
using OpenTK.Graphics;
using osu.Framework.Configuration;
2017-05-25 02:11:07 +08:00
2017-06-16 16:36:23 +08:00
namespace osu.Game.Overlays.Profile
2017-05-25 02:11:07 +08:00
{
2017-06-09 14:53:00 +08:00
public abstract class ProfileSection : FillFlowContainer
2017-05-25 02:11:07 +08:00
{
public abstract string Title { get; }
2017-06-15 23:47:34 +08:00
public abstract string Identifier { get; }
2017-06-09 15:22:07 +08:00
private readonly FillFlowContainer content;
2017-09-14 19:05:43 +08:00
2017-06-09 15:22:07 +08:00
protected override Container<Drawable> Content => content;
public readonly Bindable<User> User = new Bindable<User>();
2017-09-14 19:05:43 +08:00
2017-06-09 14:53:00 +08:00
protected ProfileSection()
2017-05-25 02:11:07 +08:00
{
2017-06-09 14:53:00 +08:00
Direction = FillDirection.Vertical;
AutoSizeAxes = Axes.Y;
RelativeSizeAxes = Axes.X;
2017-06-09 15:22:07 +08:00
InternalChildren = new Drawable[]
2017-06-09 14:53:00 +08:00
{
new OsuSpriteText
{
Text = Title,
2017-06-15 07:23:30 +08:00
TextSize = 20,
2017-06-09 14:53:00 +08:00
Font = @"Exo2.0-RegularItalic",
2017-06-09 15:22:07 +08:00
Margin = new MarginPadding
{
2017-06-15 17:03:33 +08:00
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN,
2017-07-13 13:23:52 +08:00
Vertical = 10
2017-06-09 15:22:07 +08:00
}
},
content = new FillFlowContainer
{
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
2017-06-23 21:59:22 +08:00
Padding = new MarginPadding
2017-06-09 15:22:07 +08:00
{
2017-06-15 17:03:33 +08:00
Horizontal = UserProfileOverlay.CONTENT_X_MARGIN,
2017-06-23 21:59:22 +08:00
Bottom = 20
2017-06-09 15:22:07 +08:00
}
2017-06-09 14:53:00 +08:00
},
new Box
{
RelativeSizeAxes = Axes.X,
Height = 1,
Colour = OsuColour.Gray(34),
2017-06-09 15:22:07 +08:00
EdgeSmoothness = new Vector2(1)
2017-06-09 14:53:00 +08:00
}
};
2017-06-23 21:59:22 +08:00
// placeholder
Add(new OsuSpriteText
{
2017-07-13 13:24:08 +08:00
Text = @"coming soon!",
TextSize = 16,
Font = @"Exo2.0-Medium",
Colour = Color4.Gray,
2017-06-23 21:59:22 +08:00
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
2017-07-13 13:24:08 +08:00
Margin = new MarginPadding { Top = 100, Bottom = 100 }
2017-06-23 21:59:22 +08:00
});
2017-05-25 02:11:07 +08:00
}
}
}