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:
parent
813ee19728
commit
82f9ca3de9
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user