mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 09:20:02 +09:00
Localise beatmap listing enum values
This commit is contained in:
@ -1,10 +1,14 @@
|
||||
// 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.Localisation;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
|
||||
namespace osu.Game.Overlays.BeatmapListing
|
||||
{
|
||||
[LocalisableEnum(typeof(SearchExtraEnumLocalisationMapper))]
|
||||
public enum SearchExtra
|
||||
{
|
||||
[Description("Has Video")]
|
||||
@ -13,4 +17,22 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
[Description("Has Storyboard")]
|
||||
Storyboard
|
||||
}
|
||||
|
||||
public class SearchExtraEnumLocalisationMapper : EnumLocalisationMapper<SearchExtra>
|
||||
{
|
||||
public override LocalisableString Map(SearchExtra value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case SearchExtra.Video:
|
||||
return BeatmapsStrings.ExtraVideo;
|
||||
|
||||
case SearchExtra.Storyboard:
|
||||
return BeatmapsStrings.ExtraStoryboard;
|
||||
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(value), value, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user