Create section classes.

This commit is contained in:
Huo Yaoyuan 2017-06-07 22:49:14 +08:00
parent e94d98fa84
commit e3cdb9f6fe
10 changed files with 124 additions and 2 deletions

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Users.Profile
{
public class AboutSection : ProfileSection
{
public override string Title => "me!";
public AboutSection(User user) : base(user)
{
}
}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Users.Profile
{
public class BeatmapsSection : ProfileSection
{
public override string Title => "Beatmaps";
public BeatmapsSection(User user) : base(user)
{
}
}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Users.Profile
{
public class HistoricalSection : ProfileSection
{
public override string Title => "Historical";
public HistoricalSection(User user) : base(user)
{
}
}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Users.Profile
{
public class KudosuSection : ProfileSection
{
public override string Title => "Kudosu!";
public KudosuSection(User user) : base(user)
{
}
}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Users.Profile
{
public class MedalsSection : ProfileSection
{
public override string Title => "Medals";
public MedalsSection(User user) : base(user)
{
}
}
}

View File

@ -14,5 +14,7 @@ namespace osu.Game.Users.Profile
{
User = user;
}
public override string ToString() => Title; //for tab control
}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Users.Profile
{
public class RanksSection : ProfileSection
{
public override string Title => "Ranks";
public RanksSection(User user) : base(user)
{
}
}
}

View File

@ -0,0 +1,14 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
namespace osu.Game.Users.Profile
{
public class RecentSection : ProfileSection
{
public override string Title => "Recent";
public RecentSection(User user) : base(user)
{
}
}
}

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
@ -21,8 +22,22 @@ namespace osu.Game.Users
public UserProfile(User user)
{
this.user = user;
var tab = new OsuTabControl<ProfileSection>();
var sections = new ProfileSection[] { };
var sections = new ProfileSection[]
{
new AboutSection(user),
new RecentSection(user),
new RanksSection(user),
new MedalsSection(user),
new HistoricalSection(user),
new BeatmapsSection(user),
new KudosuSection(user)
};
var tab = new OsuTabControl<ProfileSection>
{
RelativeSizeAxes = Axes.X,
Height = 24
};
sections.ForEach(tab.AddItem);
Add(new Box
{

View File

@ -88,6 +88,13 @@
<Compile Include="Overlays\Settings\SettingsHeader.cs" />
<Compile Include="Overlays\Settings\Sections\Audio\MainMenuSettings.cs" />
<Compile Include="Overlays\Toolbar\ToolbarChatButton.cs" />
<Compile Include="Users\Profile\AboutSection.cs" />
<Compile Include="Users\Profile\BeatmapsSection.cs" />
<Compile Include="Users\Profile\HistoricalSection.cs" />
<Compile Include="Users\Profile\KudosuSection.cs" />
<Compile Include="Users\Profile\MedalsSection.cs" />
<Compile Include="Users\Profile\RanksSection.cs" />
<Compile Include="Users\Profile\RecentSection.cs" />
<Compile Include="Users\UserCoverBackground.cs" />
<Compile Include="Users\UserProfile.cs" />
<Compile Include="Users\Profile\ProfileHeader.cs" />