2019-01-24 16:43:03 +08:00
|
|
|
|
// 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 17:19:50 +08:00
|
|
|
|
|
2022-08-30 17:09:10 +08:00
|
|
|
|
using System.Diagnostics;
|
2019-03-06 15:09:21 +08:00
|
|
|
|
using osu.Framework.Bindables;
|
2019-04-26 12:49:44 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2021-07-17 20:46:14 +08:00
|
|
|
|
using osu.Framework.Localisation;
|
2019-04-26 12:49:44 +08:00
|
|
|
|
using osu.Game.Overlays.Profile.Header;
|
2022-12-31 01:44:03 +08:00
|
|
|
|
using osu.Game.Overlays.Profile.Header.Components;
|
2021-07-17 20:46:14 +08:00
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-06-16 16:36:23 +08:00
|
|
|
|
namespace osu.Game.Overlays.Profile
|
2017-05-25 02:11:07 +08:00
|
|
|
|
{
|
2021-07-19 01:18:06 +08:00
|
|
|
|
public partial class ProfileHeader : TabControlOverlayHeader<LocalisableString>
|
2017-05-25 02:11:07 +08:00
|
|
|
|
{
|
2023-01-11 02:24:54 +08:00
|
|
|
|
public Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
|
2019-05-20 17:02:13 +08:00
|
|
|
|
|
|
|
|
|
private CentreHeaderContainer centreHeaderContainer;
|
|
|
|
|
private DetailHeaderContainer detailHeaderContainer;
|
2018-12-25 08:09:49 +08:00
|
|
|
|
|
2018-12-22 23:51:24 +08:00
|
|
|
|
public ProfileHeader()
|
2017-05-27 23:37:15 +08:00
|
|
|
|
{
|
2020-07-22 03:56:44 +08:00
|
|
|
|
ContentSidePadding = UserProfileOverlay.CONTENT_X_MARGIN;
|
2020-07-22 01:11:10 +08:00
|
|
|
|
|
2021-07-19 01:18:06 +08:00
|
|
|
|
TabControl.AddItem(LayoutStrings.HeaderUsersShow);
|
2022-04-29 11:55:58 +08:00
|
|
|
|
|
|
|
|
|
// todo: pending implementation.
|
|
|
|
|
// TabControl.AddItem(LayoutStrings.HeaderUsersModding);
|
2021-07-19 01:18:06 +08:00
|
|
|
|
|
2022-08-30 17:09:10 +08:00
|
|
|
|
// Haphazardly guaranteed by OverlayHeader constructor (see CreateBackground / CreateContent).
|
|
|
|
|
Debug.Assert(centreHeaderContainer != null);
|
|
|
|
|
Debug.Assert(detailHeaderContainer != null);
|
2019-05-20 17:02:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-01 02:36:17 +08:00
|
|
|
|
protected override Drawable CreateBackground() => Empty();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-12-27 11:36:41 +08:00
|
|
|
|
protected override Drawable CreateContent() => new FillFlowContainer
|
2019-05-20 17:02:13 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
AutoSizeAxes = Axes.Y,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
2017-06-06 11:25:16 +08:00
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
2019-05-20 17:02:13 +08:00
|
|
|
|
new TopHeaderContainer
|
2017-06-06 11:25:16 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2023-01-11 02:24:54 +08:00
|
|
|
|
User = { BindTarget = User },
|
2018-12-22 23:51:24 +08:00
|
|
|
|
},
|
2023-01-01 00:41:57 +08:00
|
|
|
|
new MedalHeaderContainer
|
2018-12-22 23:51:24 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2023-01-11 02:24:54 +08:00
|
|
|
|
User = { BindTarget = User },
|
2017-06-13 03:31:17 +08:00
|
|
|
|
},
|
2019-05-20 17:02:13 +08:00
|
|
|
|
detailHeaderContainer = new DetailHeaderContainer
|
2018-07-10 12:06:03 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2023-01-11 02:24:54 +08:00
|
|
|
|
User = { BindTarget = User },
|
2019-05-20 17:02:13 +08:00
|
|
|
|
},
|
2023-01-01 00:41:57 +08:00
|
|
|
|
centreHeaderContainer = new CentreHeaderContainer
|
2019-05-20 17:02:13 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2023-01-11 02:24:54 +08:00
|
|
|
|
User = { BindTarget = User },
|
2019-05-20 17:02:13 +08:00
|
|
|
|
},
|
|
|
|
|
new BottomHeaderContainer
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2023-01-11 02:24:54 +08:00
|
|
|
|
User = { BindTarget = User },
|
2019-05-20 17:02:13 +08:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2020-03-25 05:08:20 +08:00
|
|
|
|
protected override OverlayTitle CreateTitle() => new ProfileHeaderTitle();
|
2018-12-22 23:51:24 +08:00
|
|
|
|
|
2023-01-14 04:50:12 +08:00
|
|
|
|
protected override Drawable CreateTabControlContent() => new ProfileRulesetSelector
|
|
|
|
|
{
|
|
|
|
|
User = { BindTarget = User }
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-25 05:08:20 +08:00
|
|
|
|
private partial class ProfileHeaderTitle : OverlayTitle
|
2019-04-04 06:24:42 +08:00
|
|
|
|
{
|
|
|
|
|
public ProfileHeaderTitle()
|
|
|
|
|
{
|
2021-07-17 20:46:14 +08:00
|
|
|
|
Title = PageTitleStrings.MainUsersControllerDefault;
|
2020-09-03 15:26:09 +08:00
|
|
|
|
IconTexture = "Icons/Hexacons/profile";
|
2019-04-04 06:24:42 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-05-25 02:11:07 +08:00
|
|
|
|
}
|
|
|
|
|
}
|