1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 21:02:54 +08:00
osu-lazer/osu.Game/Overlays/Dashboard/Friends/UserSortTabControl.cs

45 lines
1.3 KiB
C#
Raw Normal View History

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.
using System;
2020-02-24 10:47:21 +08:00
using System.ComponentModel;
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>
{
}
[LocalisableEnum(typeof(UserSortCriteriaEnumLocalisationMappper))]
2020-02-24 10:47:21 +08:00
public enum UserSortCriteria
{
[Description(@"Recently Active")]
LastVisit,
Rank,
Username
}
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
}