mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Implement enum attributes to set display order
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
// 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;
|
||||
using System.ComponentModel;
|
||||
using osu.Framework.IO.Network;
|
||||
using osu.Game.Overlays;
|
||||
@ -92,19 +93,59 @@ namespace osu.Game.Online.API.Requests
|
||||
Electronic = 10
|
||||
}
|
||||
|
||||
[HasOrderedElements]
|
||||
public enum BeatmapSearchLanguage
|
||||
{
|
||||
[Order(0)]
|
||||
Any,
|
||||
|
||||
[Order(11)]
|
||||
Other,
|
||||
|
||||
[Order(1)]
|
||||
English,
|
||||
|
||||
[Order(6)]
|
||||
Japanese,
|
||||
|
||||
[Order(2)]
|
||||
Chinese,
|
||||
|
||||
[Order(10)]
|
||||
Instrumental,
|
||||
|
||||
[Order(7)]
|
||||
Korean,
|
||||
|
||||
[Order(3)]
|
||||
French,
|
||||
|
||||
[Order(4)]
|
||||
German,
|
||||
|
||||
[Order(9)]
|
||||
Swedish,
|
||||
|
||||
[Order(8)]
|
||||
Spanish,
|
||||
|
||||
[Order(5)]
|
||||
Italian
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public class OrderAttribute : Attribute
|
||||
{
|
||||
public readonly int Order;
|
||||
|
||||
public OrderAttribute(int order)
|
||||
{
|
||||
Order = order;
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Enum)]
|
||||
public class HasOrderedElementsAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user