mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Order sections.
This commit is contained in:
parent
2770ccb782
commit
9a77332063
@ -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);
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
// 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 override string Identifier => "me";
|
||||
}
|
||||
}
|
||||
|
@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
|
||||
public class BeatmapsSection : ProfileSection
|
||||
{
|
||||
public override string Title => "Beatmaps";
|
||||
|
||||
public override string Identifier => "beatmaps";
|
||||
}
|
||||
}
|
||||
|
@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
|
||||
public class HistoricalSection : ProfileSection
|
||||
{
|
||||
public override string Title => "Historical";
|
||||
|
||||
public override string Identifier => "historical";
|
||||
}
|
||||
}
|
||||
|
@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
|
||||
public class KudosuSection : ProfileSection
|
||||
{
|
||||
public override string Title => "Kudosu!";
|
||||
|
||||
public override string Identifier => "kudosu";
|
||||
}
|
||||
}
|
||||
|
@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
|
||||
public class MedalsSection : ProfileSection
|
||||
{
|
||||
public override string Title => "Medals";
|
||||
|
||||
public override string Identifier => "medals";
|
||||
}
|
||||
}
|
||||
|
@ -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<Drawable> Content => content;
|
||||
|
||||
|
@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
|
||||
public class RanksSection : ProfileSection
|
||||
{
|
||||
public override string Title => "Ranks";
|
||||
|
||||
public override string Identifier => "top_ranks";
|
||||
}
|
||||
}
|
||||
|
@ -6,5 +6,7 @@ namespace osu.Game.Users.Profile
|
||||
public class RecentSection : ProfileSection
|
||||
{
|
||||
public override string Title => "Recent";
|
||||
|
||||
public override string Identifier => "recent_activities";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user