diff --git a/osu.Game/Overlays/BeatmapListing/BeatmapSearchFilterRow.cs b/osu.Game/Overlays/BeatmapListing/BeatmapSearchFilterRow.cs index 8be0fca629..2c046a2bbf 100644 --- a/osu.Game/Overlays/BeatmapListing/BeatmapSearchFilterRow.cs +++ b/osu.Game/Overlays/BeatmapListing/BeatmapSearchFilterRow.cs @@ -116,7 +116,7 @@ namespace osu.Game.Overlays.BeatmapListing text = new OsuSpriteText { Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Regular), - Text = GetText(value) + Text = (value as Enum)?.GetDescription() ?? value.ToString() }, new HoverClickSounds() }); @@ -130,8 +130,6 @@ namespace osu.Game.Overlays.BeatmapListing updateState(); } - protected virtual string GetText(T value) => (value as Enum)?.GetDescription() ?? value.ToString(); - protected override bool OnHover(HoverEvent e) { base.OnHover(e); diff --git a/osu.Game/Overlays/BeatmapListing/BeatmapSearchRulesetFilterRow.cs b/osu.Game/Overlays/BeatmapListing/BeatmapSearchRulesetFilterRow.cs index d30364ab0d..eebd896cf9 100644 --- a/osu.Game/Overlays/BeatmapListing/BeatmapSearchRulesetFilterRow.cs +++ b/osu.Game/Overlays/BeatmapListing/BeatmapSearchRulesetFilterRow.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; -using osu.Framework.Graphics.UserInterface; using osu.Game.Rulesets; namespace osu.Game.Overlays.BeatmapListing @@ -29,18 +28,6 @@ namespace osu.Game.Overlays.BeatmapListing foreach (var r in rulesets.AvailableRulesets) AddItem(r); } - - protected override TabItem CreateTabItem(RulesetInfo value) => new RulesetTabItem(value); - - private class RulesetTabItem : FilterTabItem - { - public RulesetTabItem(RulesetInfo value) - : base(value) - { - } - - protected override string GetText(RulesetInfo value) => value.Name; - } } } } diff --git a/osu.Game/Rulesets/RulesetInfo.cs b/osu.Game/Rulesets/RulesetInfo.cs index ececc18c96..afd499cb9e 100644 --- a/osu.Game/Rulesets/RulesetInfo.cs +++ b/osu.Game/Rulesets/RulesetInfo.cs @@ -50,6 +50,6 @@ namespace osu.Game.Rulesets } } - public override string ToString() => $"{Name} ({ShortName}) ID: {ID}"; + public override string ToString() => Name ?? $"{Name} ({ShortName}) ID: {ID}"; } }