mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 10:33:07 +08:00
Basic section management of userpage.
This commit is contained in:
parent
16212fce19
commit
9bc1eece0a
16
osu.Game/Overlays/UserPage/UserPageHeader.cs
Normal file
16
osu.Game/Overlays/UserPage/UserPageHeader.cs
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// 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.Containers;
|
||||
|
||||
namespace osu.Game.Overlays.UserPage
|
||||
{
|
||||
public class UserPageHeader : Container
|
||||
{
|
||||
}
|
||||
}
|
19
osu.Game/Overlays/UserPage/UserPageSection.cs
Normal file
19
osu.Game/Overlays/UserPage/UserPageSection.cs
Normal file
@ -0,0 +1,19 @@
|
||||
// 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.Graphics.Containers;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays.UserPage
|
||||
{
|
||||
public abstract class UserPageSection : Container
|
||||
{
|
||||
protected readonly User User;
|
||||
public abstract string Title { get; }
|
||||
|
||||
protected UserPageSection(User user)
|
||||
{
|
||||
User = user;
|
||||
}
|
||||
}
|
||||
}
|
54
osu.Game/Overlays/UserPageOverlay.cs
Normal file
54
osu.Game/Overlays/UserPageOverlay.cs
Normal file
@ -0,0 +1,54 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// 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.Containers;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays.UserPage;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays
|
||||
{
|
||||
public class UserPageOverlay : FocusedOverlayContainer
|
||||
{
|
||||
private readonly User user;
|
||||
private UserPageSection lastSection;
|
||||
public UserPageOverlay(User user)
|
||||
{
|
||||
this.user = user;
|
||||
var tab = new OsuTabControl<UserPageSection>();
|
||||
var sections = new UserPageSection[] { };
|
||||
var sectionsContainer = new SectionsContainer
|
||||
{
|
||||
ExpandableHeader = new UserPageHeader(),
|
||||
FixedHeader = tab,
|
||||
Sections = sections
|
||||
};
|
||||
|
||||
Add(sectionsContainer);
|
||||
|
||||
sectionsContainer.SelectedSection.ValueChanged += s =>
|
||||
{
|
||||
if (lastSection != s)
|
||||
{
|
||||
lastSection = s as UserPageSection;
|
||||
tab.Current.Value = lastSection;
|
||||
}
|
||||
};
|
||||
|
||||
tab.Current.ValueChanged += s =>
|
||||
{
|
||||
if (lastSection != s)
|
||||
{
|
||||
lastSection = s;
|
||||
sectionsContainer.ScrollContainer.ScrollIntoView(lastSection);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -85,6 +85,9 @@
|
||||
<Compile Include="Overlays\Settings\SettingsHeader.cs" />
|
||||
<Compile Include="Overlays\Settings\Sections\Audio\MainMenuSettings.cs" />
|
||||
<Compile Include="Overlays\Toolbar\ToolbarChatButton.cs" />
|
||||
<Compile Include="Overlays\UserPageOverlay.cs" />
|
||||
<Compile Include="Overlays\UserPage\UserPageHeader.cs" />
|
||||
<Compile Include="Overlays\UserPage\UserPageSection.cs" />
|
||||
<Compile Include="Rulesets\Beatmaps\BeatmapConverter.cs" />
|
||||
<Compile Include="Rulesets\Beatmaps\BeatmapProcessor.cs" />
|
||||
<Compile Include="Beatmaps\ControlPoints\ControlPoint.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user