1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 17:43:05 +08:00

Order sections.

This commit is contained in:
Huo Yaoyuan 2017-06-15 23:47:34 +08:00
parent 2770ccb782
commit 9a77332063
9 changed files with 22 additions and 3 deletions

View File

@ -4,7 +4,6 @@
using System.Linq; using System.Linq;
using OpenTK; using OpenTK;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.UserInterface; using osu.Framework.Graphics.UserInterface;
@ -105,8 +104,11 @@ namespace osu.Game.Overlays
userReq.Success += u => userReq.Success += u =>
{ {
header.FillFullData(u); header.FillFullData(u);
sectionsContainer.Children = sections;
sections.ForEach(tabs.AddItem); var reorderedSections = u.ProfileOrder.Select(x => sections.FirstOrDefault(s => s.Identifier == x)).Where(s => s != null).ToList();
sectionsContainer.Children = reorderedSections;
reorderedSections.ForEach(tabs.AddItem);
}; };
api.Queue(userReq); api.Queue(userReq);

View File

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

View File

@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
public class BeatmapsSection : ProfileSection public class BeatmapsSection : ProfileSection
{ {
public override string Title => "Beatmaps"; public override string Title => "Beatmaps";
public override string Identifier => "beatmaps";
} }
} }

View File

@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
public class HistoricalSection : ProfileSection public class HistoricalSection : ProfileSection
{ {
public override string Title => "Historical"; public override string Title => "Historical";
public override string Identifier => "historical";
} }
} }

View File

@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
public class KudosuSection : ProfileSection public class KudosuSection : ProfileSection
{ {
public override string Title => "Kudosu!"; public override string Title => "Kudosu!";
public override string Identifier => "kudosu";
} }
} }

View File

@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
public class MedalsSection : ProfileSection public class MedalsSection : ProfileSection
{ {
public override string Title => "Medals"; public override string Title => "Medals";
public override string Identifier => "medals";
} }
} }

View File

@ -15,6 +15,8 @@ namespace osu.Game.Users.Profile
{ {
public abstract string Title { get; } public abstract string Title { get; }
public abstract string Identifier { get; }
private readonly FillFlowContainer content; private readonly FillFlowContainer content;
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;

View File

@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
public class RanksSection : ProfileSection public class RanksSection : ProfileSection
{ {
public override string Title => "Ranks"; public override string Title => "Ranks";
public override string Identifier => "top_ranks";
} }
} }

View File

@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
public class RecentSection : ProfileSection public class RecentSection : ProfileSection
{ {
public override string Title => "Recent"; public override string Title => "Recent";
public override string Identifier => "recent_activities";
} }
} }