1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-04 03:13:11 +08:00

Allow searching enum descriptions from SettingsEnumDropdowns

This commit is contained in:
Joseph Madamba 2024-08-03 14:48:08 -07:00
parent 7765d0ff70
commit 2daf1b58f2

View File

@ -2,7 +2,11 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterface;
namespace osu.Game.Overlays.Settings
@ -10,6 +14,8 @@ namespace osu.Game.Overlays.Settings
public partial class SettingsEnumDropdown<T> : SettingsDropdown<T>
where T : struct, Enum
{
public override IEnumerable<LocalisableString> FilterTerms => base.FilterTerms.Concat(Control.Items.Select(i => i.GetLocalisableDescription()));
protected override OsuDropdown<T> CreateDropdown() => new DropdownControl();
protected new partial class DropdownControl : OsuEnumDropdown<T>