1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 03:22:55 +08:00

Bind to filter event changes in base drawable item

This commit is contained in:
Dean Herbert 2020-10-12 20:02:06 +09:00
parent 813ee19728
commit 82f9ca3de9

View File

@ -40,6 +40,12 @@ namespace osu.Game.Screens.Select.Carousel
{
Item.Filtered.ValueChanged -= onStateChange;
Item.State.ValueChanged -= onStateChange;
if (item is CarouselGroup group)
{
foreach (var c in group.Children)
c.Filtered.ValueChanged -= onStateChange;
}
}
item = value;
@ -129,6 +135,12 @@ namespace osu.Game.Screens.Select.Carousel
Item.Filtered.ValueChanged += onStateChange;
Item.State.ValueChanged += onStateChange;
if (Item is CarouselGroup group)
{
foreach (var c in group.Children)
c.Filtered.ValueChanged += onStateChange;
}
}
private void onStateChange(ValueChangedEvent<CarouselItemState> obj) => Scheduler.AddOnce(ApplyState);