Make playlist filtering work.

Also standardises searchable terms in beatmap metadata.
This commit is contained in:
Dean Herbert
2017-05-02 10:45:55 +09:00
parent b07af21202
commit 6074cb5979
5 changed files with 60 additions and 16 deletions

View File

@ -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);
}
}
}
}