mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:13:21 +08:00
Filter the playlist overlay's beatmap list
This commit is contained in:
parent
1b95991e40
commit
03c13620c8
@ -35,7 +35,41 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
||||
|
||||
public bool AllowBeatmapChange = true;
|
||||
private bool allowBeatmapChange = true;
|
||||
|
||||
public bool AllowBeatmapChange
|
||||
{
|
||||
get
|
||||
{
|
||||
return allowBeatmapChange;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (!IsLoaded || allowBeatmapChange == value) return;
|
||||
|
||||
allowBeatmapChange = value;
|
||||
|
||||
// Get the new list of available beatmap sets
|
||||
if (allowBeatmapChange)
|
||||
list.BeatmapSets = BeatmapSets;
|
||||
else if (beatmapBacking.Value != null)
|
||||
{
|
||||
list.BeatmapSets = new List<BeatmapSetInfo>()
|
||||
{
|
||||
beatmapBacking.Value.BeatmapSetInfo
|
||||
};
|
||||
}
|
||||
else
|
||||
list.BeatmapSets = new List<BeatmapSetInfo>();
|
||||
|
||||
// Apply the current filter
|
||||
list.Filter(filter.Search.Text);
|
||||
|
||||
// Select the current beatmap
|
||||
if (beatmapBacking.Value != null)
|
||||
list.SelectedItem = beatmapBacking.Value.BeatmapSetInfo;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<BeatmapSetInfo> BeatmapSets;
|
||||
private InputManager inputManager;
|
||||
|
Loading…
Reference in New Issue
Block a user