mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Move RankingsScope
to own file and fix mapper strings
This commit is contained in:
parent
944bf2c4f9
commit
456f4e6f1f
@ -1,13 +1,10 @@
|
||||
// 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 osu.Framework.Graphics;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Localisation;
|
||||
using osu.Game.Rulesets;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
using osu.Game.Users;
|
||||
|
||||
namespace osu.Game.Overlays.Rankings
|
||||
@ -39,37 +36,4 @@ namespace osu.Game.Overlays.Rankings
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[LocalisableEnum(typeof(RankingsScopeEnumLocalisationMapper))]
|
||||
public enum RankingsScope
|
||||
{
|
||||
Performance,
|
||||
Spotlights,
|
||||
Score,
|
||||
Country
|
||||
}
|
||||
|
||||
public class RankingsScopeEnumLocalisationMapper : EnumLocalisationMapper<RankingsScope>
|
||||
{
|
||||
public override LocalisableString Map(RankingsScope value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case RankingsScope.Performance:
|
||||
return LayoutStrings.MenuRankingsIndex;
|
||||
|
||||
case RankingsScope.Spotlights:
|
||||
return LayoutStrings.MenuRankingsCharts;
|
||||
|
||||
case RankingsScope.Score:
|
||||
return LayoutStrings.MenuRankingsScore;
|
||||
|
||||
case RankingsScope.Country:
|
||||
return LayoutStrings.MenuRankingsCountry;
|
||||
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(value), value, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
42
osu.Game/Overlays/Rankings/RankingsScope.cs
Normal file
42
osu.Game/Overlays/Rankings/RankingsScope.cs
Normal file
@ -0,0 +1,42 @@
|
||||
// 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 osu.Framework.Localisation;
|
||||
using osu.Game.Resources.Localisation.Web;
|
||||
|
||||
namespace osu.Game.Overlays.Rankings
|
||||
{
|
||||
[LocalisableEnum(typeof(RankingsScopeEnumLocalisationMapper))]
|
||||
public enum RankingsScope
|
||||
{
|
||||
Performance,
|
||||
Spotlights,
|
||||
Score,
|
||||
Country
|
||||
}
|
||||
|
||||
public class RankingsScopeEnumLocalisationMapper : EnumLocalisationMapper<RankingsScope>
|
||||
{
|
||||
public override LocalisableString Map(RankingsScope value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case RankingsScope.Performance:
|
||||
return RankingsStrings.TypePerformance;
|
||||
|
||||
case RankingsScope.Spotlights:
|
||||
return RankingsStrings.TypeCharts;
|
||||
|
||||
case RankingsScope.Score:
|
||||
return RankingsStrings.TypeScore;
|
||||
|
||||
case RankingsScope.Country:
|
||||
return RankingsStrings.TypeCountry;
|
||||
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(value), value, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user