mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Debounce state application events
This commit is contained in:
@ -125,15 +125,15 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
if (item == null)
|
if (item == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ApplyState();
|
Scheduler.AddOnce(ApplyState);
|
||||||
|
|
||||||
Item.Filtered.ValueChanged += onStateChange;
|
Item.Filtered.ValueChanged += onStateChange;
|
||||||
Item.State.ValueChanged += onStateChange;
|
Item.State.ValueChanged += onStateChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onStateChange(ValueChangedEvent<CarouselItemState> obj) => Schedule(ApplyState);
|
private void onStateChange(ValueChangedEvent<CarouselItemState> obj) => Scheduler.AddOnce(ApplyState);
|
||||||
|
|
||||||
private void onStateChange(ValueChangedEvent<bool> _) => Schedule(ApplyState);
|
private void onStateChange(ValueChangedEvent<bool> _) => Scheduler.AddOnce(ApplyState);
|
||||||
|
|
||||||
protected virtual void ApplyState()
|
protected virtual void ApplyState()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user