diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index 8be3058166..2042348d94 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -4,7 +4,6 @@ using System.Linq; using OpenTK; using osu.Framework.Allocation; -using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.UserInterface; @@ -105,8 +104,11 @@ namespace osu.Game.Overlays userReq.Success += 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); diff --git a/osu.Game/Users/Profile/AboutSection.cs b/osu.Game/Users/Profile/AboutSection.cs index 69ace5fc71..572eb1a273 100644 --- a/osu.Game/Users/Profile/AboutSection.cs +++ b/osu.Game/Users/Profile/AboutSection.cs @@ -1,10 +1,13 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // 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 override string Identifier => "me"; } } diff --git a/osu.Game/Users/Profile/BeatmapsSection.cs b/osu.Game/Users/Profile/BeatmapsSection.cs index a69c65c84a..eb460bbbec 100644 --- a/osu.Game/Users/Profile/BeatmapsSection.cs +++ b/osu.Game/Users/Profile/BeatmapsSection.cs @@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile public class BeatmapsSection : ProfileSection { public override string Title => "Beatmaps"; + + public override string Identifier => "beatmaps"; } } diff --git a/osu.Game/Users/Profile/HistoricalSection.cs b/osu.Game/Users/Profile/HistoricalSection.cs index c5f357d322..1b767662cf 100644 --- a/osu.Game/Users/Profile/HistoricalSection.cs +++ b/osu.Game/Users/Profile/HistoricalSection.cs @@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile public class HistoricalSection : ProfileSection { public override string Title => "Historical"; + + public override string Identifier => "historical"; } } diff --git a/osu.Game/Users/Profile/KudosuSection.cs b/osu.Game/Users/Profile/KudosuSection.cs index b489f6544d..3502c61822 100644 --- a/osu.Game/Users/Profile/KudosuSection.cs +++ b/osu.Game/Users/Profile/KudosuSection.cs @@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile public class KudosuSection : ProfileSection { public override string Title => "Kudosu!"; + + public override string Identifier => "kudosu"; } } diff --git a/osu.Game/Users/Profile/MedalsSection.cs b/osu.Game/Users/Profile/MedalsSection.cs index 0a52830340..18ef779f83 100644 --- a/osu.Game/Users/Profile/MedalsSection.cs +++ b/osu.Game/Users/Profile/MedalsSection.cs @@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile public class MedalsSection : ProfileSection { public override string Title => "Medals"; + + public override string Identifier => "medals"; } } diff --git a/osu.Game/Users/Profile/ProfileSection.cs b/osu.Game/Users/Profile/ProfileSection.cs index 723024d6a6..ec938c13ac 100644 --- a/osu.Game/Users/Profile/ProfileSection.cs +++ b/osu.Game/Users/Profile/ProfileSection.cs @@ -15,6 +15,8 @@ namespace osu.Game.Users.Profile { public abstract string Title { get; } + public abstract string Identifier { get; } + private readonly FillFlowContainer content; protected override Container Content => content; diff --git a/osu.Game/Users/Profile/RanksSection.cs b/osu.Game/Users/Profile/RanksSection.cs index 65f3f04c1b..b2a35dbd21 100644 --- a/osu.Game/Users/Profile/RanksSection.cs +++ b/osu.Game/Users/Profile/RanksSection.cs @@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile public class RanksSection : ProfileSection { public override string Title => "Ranks"; + + public override string Identifier => "top_ranks"; } } diff --git a/osu.Game/Users/Profile/RecentSection.cs b/osu.Game/Users/Profile/RecentSection.cs index 6cd3bf6c49..b1961491bb 100644 --- a/osu.Game/Users/Profile/RecentSection.cs +++ b/osu.Game/Users/Profile/RecentSection.cs @@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile public class RecentSection : ProfileSection { public override string Title => "Recent"; + + public override string Identifier => "recent_activities"; } }