2020-02-24 10:47:21 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
2021-07-01 03:28:07 +08:00
|
|
|
|
using System;
|
2020-02-24 10:47:21 +08:00
|
|
|
|
using System.ComponentModel;
|
2021-07-01 03:28:07 +08:00
|
|
|
|
using osu.Framework.Localisation;
|
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2020-02-24 10:47:21 +08:00
|
|
|
|
|
2020-03-16 14:42:21 +08:00
|
|
|
|
namespace osu.Game.Overlays.Dashboard.Friends
|
2020-02-24 10:47:21 +08:00
|
|
|
|
{
|
|
|
|
|
public class UserSortTabControl : OverlaySortTabControl<UserSortCriteria>
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-01 03:28:07 +08:00
|
|
|
|
[LocalisableEnum(typeof(UserSortCriteriaEnumLocalisationMappper))]
|
2020-02-24 10:47:21 +08:00
|
|
|
|
public enum UserSortCriteria
|
|
|
|
|
{
|
|
|
|
|
[Description(@"Recently Active")]
|
|
|
|
|
LastVisit,
|
|
|
|
|
Rank,
|
|
|
|
|
Username
|
|
|
|
|
}
|
2021-07-01 03:28:07 +08:00
|
|
|
|
|
|
|
|
|
public class UserSortCriteriaEnumLocalisationMappper : EnumLocalisationMapper<UserSortCriteria>
|
|
|
|
|
{
|
|
|
|
|
public override LocalisableString Map(UserSortCriteria value)
|
|
|
|
|
{
|
|
|
|
|
switch (value)
|
|
|
|
|
{
|
|
|
|
|
case UserSortCriteria.LastVisit:
|
|
|
|
|
return SortStrings.LastVisit;
|
|
|
|
|
|
|
|
|
|
case UserSortCriteria.Rank:
|
|
|
|
|
return SortStrings.Rank;
|
|
|
|
|
|
|
|
|
|
case UserSortCriteria.Username:
|
|
|
|
|
return SortStrings.Username;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(value), value, null);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-02-24 10:47:21 +08:00
|
|
|
|
}
|