Fix regression in bpm textbox binding logic

This commit is contained in:
Dean Herbert 2022-05-31 18:27:18 +09:00
parent 9746cbb161
commit 655780fd98

View File

@ -28,17 +28,31 @@ namespace osu.Game.Screens.Edit.Timing
});
}
protected override void LoadComplete()
{
base.LoadComplete();
bpmTextEntry.Current.BindValueChanged(_ => saveChanges());
timeSignature.Current.BindValueChanged(_ => saveChanges());
void saveChanges()
{
if (!isRebinding) ChangeHandler?.SaveState();
}
}
private bool isRebinding;
protected override void OnControlPointChanged(ValueChangedEvent<TimingControlPoint> point)
{
if (point.NewValue != null)
{
bpmTextEntry.Current.UnbindEvents();
bpmTextEntry.Bindable = point.NewValue.BeatLengthBindable;
bpmTextEntry.Current.BindValueChanged(_ => ChangeHandler?.SaveState());
isRebinding = true;
timeSignature.Current.UnbindEvents();
bpmTextEntry.Bindable = point.NewValue.BeatLengthBindable;
timeSignature.Current = point.NewValue.TimeSignatureBindable;
timeSignature.Current.BindValueChanged(_ => ChangeHandler?.SaveState());
isRebinding = false;
}
}