osu/osu.Game/Overlays/Profile/ProfileHeader.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

94 lines
3.2 KiB
C#
Raw Normal View History

// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2018-04-13 09:19:50 +00:00
using System.Diagnostics;
2019-03-06 07:09:21 +00:00
using osu.Framework.Bindables;
2019-04-26 04:49:44 +00:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2021-07-17 12:46:14 +00:00
using osu.Framework.Localisation;
2019-04-26 04:49:44 +00:00
using osu.Game.Overlays.Profile.Header;
using osu.Game.Overlays.Profile.Header.Components;
2021-07-17 12:46:14 +00:00
using osu.Game.Resources.Localisation.Web;
2018-04-13 09:19:50 +00:00
2017-06-16 08:36:23 +00:00
namespace osu.Game.Overlays.Profile
2017-05-24 18:11:07 +00:00
{
public partial class ProfileHeader : TabControlOverlayHeader<LocalisableString>
2017-05-24 18:11:07 +00:00
{
2023-01-10 18:24:54 +00:00
public Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
private CentreHeaderContainer centreHeaderContainer;
private DetailHeaderContainer detailHeaderContainer;
2018-12-25 00:09:49 +00:00
2018-12-22 15:51:24 +00:00
public ProfileHeader()
{
ContentSidePadding = WaveOverlayContainer.HORIZONTAL_PADDING;
2020-07-21 17:11:10 +00:00
TabControl.AddItem(LayoutStrings.HeaderUsersShow);
// todo: pending implementation.
// TabControl.AddItem(LayoutStrings.HeaderUsersModding);
// Haphazardly guaranteed by OverlayHeader constructor (see CreateBackground / CreateContent).
Debug.Assert(centreHeaderContainer != null);
Debug.Assert(detailHeaderContainer != null);
}
2022-12-31 18:36:17 +00:00
protected override Drawable CreateBackground() => Empty();
2018-04-13 09:19:50 +00:00
2019-12-27 03:36:41 +00:00
protected override Drawable CreateContent() => new FillFlowContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
2017-06-06 03:25:16 +00:00
Children = new Drawable[]
{
new TopHeaderContainer
2017-06-06 03:25:16 +00:00
{
RelativeSizeAxes = Axes.X,
2023-01-10 18:24:54 +00:00
User = { BindTarget = User },
2018-12-22 15:51:24 +00:00
},
new BannerHeaderContainer
{
User = { BindTarget = User },
},
new BadgeHeaderContainer
2018-12-22 15:51:24 +00:00
{
RelativeSizeAxes = Axes.X,
2023-01-10 18:24:54 +00:00
User = { BindTarget = User },
},
detailHeaderContainer = new DetailHeaderContainer
{
RelativeSizeAxes = Axes.X,
2023-01-10 18:24:54 +00:00
User = { BindTarget = User },
},
centreHeaderContainer = new CentreHeaderContainer
{
RelativeSizeAxes = Axes.X,
2023-01-10 18:24:54 +00:00
User = { BindTarget = User },
},
new BottomHeaderContainer
{
RelativeSizeAxes = Axes.X,
2023-01-10 18:24:54 +00:00
User = { BindTarget = User },
},
}
};
2018-04-13 09:19:50 +00:00
protected override OverlayTitle CreateTitle() => new ProfileHeaderTitle();
2018-12-22 15:51:24 +00:00
protected override Drawable CreateTabControlContent() => new ProfileRulesetSelector
{
User = { BindTarget = User }
};
private partial class ProfileHeaderTitle : OverlayTitle
2019-04-03 22:24:42 +00:00
{
public ProfileHeaderTitle()
{
2021-07-17 12:46:14 +00:00
Title = PageTitleStrings.MainUsersControllerDefault;
IconTexture = "Icons/Hexacons/profile";
2019-04-03 22:24:42 +00:00
}
}
2017-05-24 18:11:07 +00:00
}
}