mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Make playlist filtering work.
Also standardises searchable terms in beatmap metadata.
This commit is contained in:
@ -15,7 +15,7 @@ using osu.Framework.Localisation;
|
||||
|
||||
namespace osu.Game.Overlays.Music
|
||||
{
|
||||
internal class PlaylistItem : Container
|
||||
internal class PlaylistItem : Container, IFilterable
|
||||
{
|
||||
private const float fade_duration = 100;
|
||||
|
||||
@ -56,6 +56,8 @@ namespace osu.Game.Overlays.Music
|
||||
{
|
||||
BeatmapMetadata metadata = BeatmapSetInfo.Metadata;
|
||||
|
||||
FilterTerms = metadata.SearchableTerms;
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
handle = new TextAwesome
|
||||
@ -115,5 +117,21 @@ namespace osu.Game.Overlays.Music
|
||||
OnSelect?.Invoke(BeatmapSetInfo);
|
||||
return true;
|
||||
}
|
||||
|
||||
public string[] FilterTerms { get; private set; }
|
||||
|
||||
private bool matching = true;
|
||||
|
||||
public bool MatchingCurrentFilter
|
||||
{
|
||||
set
|
||||
{
|
||||
if (matching == value) return;
|
||||
|
||||
matching = value;
|
||||
|
||||
FadeTo(matching ? 1 : 0, 200);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user