mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Move RankingsScope
to own file and fix mapper strings
This commit is contained in:
@ -1,13 +1,10 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Localisation;
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Rankings
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user