From 82f9ca3de98d1cef76f64a6c67217384e4700460 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 12 Oct 2020 20:02:06 +0900 Subject: [PATCH] Bind to filter event changes in base drawable item --- .../Screens/Select/Carousel/DrawableCarouselItem.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs b/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs index 4ba827de86..8cf63d184c 100644 --- a/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs +++ b/osu.Game/Screens/Select/Carousel/DrawableCarouselItem.cs @@ -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 obj) => Scheduler.AddOnce(ApplyState);