mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Update with framework-side bindable list changes
This commit is contained in:
@ -125,8 +125,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
}
|
||||
|
||||
samplesBindable = HitObject.SamplesBindable.GetBoundCopy();
|
||||
samplesBindable.ItemsAdded += _ => loadSamples();
|
||||
samplesBindable.ItemsRemoved += _ => loadSamples();
|
||||
samplesBindable.CollectionChanged += (_, __) => loadSamples();
|
||||
|
||||
updateState(ArmedState.Idle, true);
|
||||
onDefaultsApplied();
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using osu.Framework.Bindables;
|
||||
@ -47,18 +48,20 @@ namespace osu.Game.Rulesets.Objects
|
||||
{
|
||||
ExpectedDistance.ValueChanged += _ => invalidate();
|
||||
|
||||
ControlPoints.ItemsAdded += items =>
|
||||
ControlPoints.CollectionChanged += (_, args) =>
|
||||
{
|
||||
foreach (var c in items)
|
||||
c.Changed += invalidate;
|
||||
switch (args.Action)
|
||||
{
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
foreach (var c in args.NewItems.Cast<PathControlPoint>())
|
||||
c.Changed += invalidate;
|
||||
break;
|
||||
|
||||
invalidate();
|
||||
};
|
||||
|
||||
ControlPoints.ItemsRemoved += items =>
|
||||
{
|
||||
foreach (var c in items)
|
||||
c.Changed -= invalidate;
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
foreach (var c in args.NewItems.Cast<PathControlPoint>())
|
||||
c.Changed -= invalidate;
|
||||
break;
|
||||
}
|
||||
|
||||
invalidate();
|
||||
};
|
||||
|
Reference in New Issue
Block a user