mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 01:47:30 +09:00
Fix filtering potentially not running after new items added
This commit is contained in:
parent
db004c9d9f
commit
c840977acb
@ -27,6 +27,12 @@ namespace osu.Game.Overlays.Music
|
|||||||
set => base.Padding = value;
|
set => base.Padding = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnItemsChanged()
|
||||||
|
{
|
||||||
|
base.OnItemsChanged();
|
||||||
|
Filter(currentCriteria);
|
||||||
|
}
|
||||||
|
|
||||||
public void Filter(FilterCriteria criteria)
|
public void Filter(FilterCriteria criteria)
|
||||||
{
|
{
|
||||||
var items = (SearchContainer<RearrangeableListItem<Live<BeatmapSetInfo>>>)ListContainer;
|
var items = (SearchContainer<RearrangeableListItem<Live<BeatmapSetInfo>>>)ListContainer;
|
||||||
@ -44,12 +50,12 @@ namespace osu.Game.Overlays.Music
|
|||||||
|
|
||||||
public Live<BeatmapSetInfo>? FirstVisibleSet => Items.FirstOrDefault(i => ((PlaylistItem)ItemMap[i]).MatchingFilter);
|
public Live<BeatmapSetInfo>? FirstVisibleSet => Items.FirstOrDefault(i => ((PlaylistItem)ItemMap[i]).MatchingFilter);
|
||||||
|
|
||||||
protected override OsuRearrangeableListItem<Live<BeatmapSetInfo>> CreateOsuDrawable(Live<BeatmapSetInfo> item) => new PlaylistItem(item)
|
protected override OsuRearrangeableListItem<Live<BeatmapSetInfo>> CreateOsuDrawable(Live<BeatmapSetInfo> item) =>
|
||||||
{
|
new PlaylistItem(item)
|
||||||
InSelectedCollection = currentCriteria.Collection?.PerformRead(c => item.Value.Beatmaps.Select(b => b.MD5Hash).Any(c.BeatmapMD5Hashes.Contains)) != false,
|
{
|
||||||
SelectedSet = { BindTarget = SelectedSet },
|
SelectedSet = { BindTarget = SelectedSet },
|
||||||
RequestSelection = set => RequestSelection?.Invoke(set)
|
RequestSelection = set => RequestSelection?.Invoke(set)
|
||||||
};
|
};
|
||||||
|
|
||||||
protected override FillFlowContainer<RearrangeableListItem<Live<BeatmapSetInfo>>> CreateListFillFlowContainer() => new SearchContainer<RearrangeableListItem<Live<BeatmapSetInfo>>>
|
protected override FillFlowContainer<RearrangeableListItem<Live<BeatmapSetInfo>>> CreateListFillFlowContainer() => new SearchContainer<RearrangeableListItem<Live<BeatmapSetInfo>>>
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user