mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Filter the playlist overlay's beatmap list
This commit is contained in:
@ -35,7 +35,41 @@ namespace osu.Game.Overlays.Music
|
|||||||
|
|
||||||
private readonly Bindable<WorkingBeatmap> beatmapBacking = new Bindable<WorkingBeatmap>();
|
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;
|
public IEnumerable<BeatmapSetInfo> BeatmapSets;
|
||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
|
Reference in New Issue
Block a user