mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 16:43:52 +09:00
Rename method
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Extensions;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.BeatmapListing
|
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)
|
switch (value)
|
||||||
{
|
{
|
||||||
@ -41,7 +42,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
return @"Silver S";
|
return @"Silver S";
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return base.CreateText(value);
|
return value.GetDescription();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
text = new OsuSpriteText
|
text = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Regular),
|
Font = OsuFont.GetFont(size: 13, weight: FontWeight.Regular),
|
||||||
Text = CreateText(value)
|
Text = LabelFor(value)
|
||||||
},
|
},
|
||||||
new HoverClickSounds()
|
new HoverClickSounds()
|
||||||
});
|
});
|
||||||
@ -63,7 +63,10 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
|
|
||||||
protected override void OnDeactivated() => updateState();
|
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()
|
private void updateState()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user