mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 16:12:57 +08:00
Rename method
This commit is contained in:
parent
f5aedc96c4
commit
a8cefb0d4c
@ -3,6 +3,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Extensions;
|
||||
using osu.Game.Scoring;
|
||||
|
||||
namespace osu.Game.Overlays.BeatmapListing
|
||||
@ -30,7 +31,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
{
|
||||
}
|
||||
|
||||
protected override string CreateText(ScoreRank value)
|
||||
protected override string LabelFor(ScoreRank value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
@ -41,7 +42,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
return @"Silver S";
|
||||
|
||||
default:
|
||||
return base.CreateText(value);
|
||||
return value.GetDescription();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
text = new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Regular),
|
||||
Text = CreateText(value)
|
||||
Text = LabelFor(value)
|
||||
},
|
||||
new HoverClickSounds()
|
||||
});
|
||||
@ -63,7 +63,10 @@ namespace osu.Game.Overlays.BeatmapListing
|
||||
|
||||
protected override void OnDeactivated() => updateState();
|
||||
|
||||
protected virtual string CreateText(T value) => (value as Enum)?.GetDescription() ?? value.ToString();
|
||||
/// <summary>
|
||||
/// Returns the label text to be used for the supplied <paramref name="value"/>.
|
||||
/// </summary>
|
||||
protected virtual string LabelFor(T value) => (value as Enum)?.GetDescription() ?? value.ToString();
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user