mirror of
https://github.com/ppy/osu
synced 2025-01-09 23:59:44 +00:00
Fix regression in bpm textbox binding logic
This commit is contained in:
parent
9746cbb161
commit
655780fd98
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user