1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:12:57 +08:00

Rename method

This commit is contained in:
Bartłomiej Dach 2020-10-28 23:12:28 +01:00
parent f5aedc96c4
commit a8cefb0d4c
2 changed files with 8 additions and 4 deletions

View File

@ -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();
}
}
}

View File

@ -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()
{