1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-31 18:43:22 +08:00

Merge pull request #29273 from Joehuu/enum-description-searching

Allow searching enum descriptions from `SettingsEnumDropdown`s
This commit is contained in:
Dean Herbert 2024-08-04 19:55:48 +09:00 committed by GitHub
commit 48b320e7dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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>