mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 20:47:51 +08:00
Add change handling for timing section
This commit is contained in:
parent
c1c5b5da8e
commit
98fd661b23
@ -32,6 +32,9 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
[Resolved]
|
||||
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; }
|
||||
|
||||
[Resolved(canBeNull: true)]
|
||||
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
|
@ -37,8 +37,13 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
if (point.NewValue != null)
|
||||
{
|
||||
bpmSlider.Bindable = point.NewValue.BeatLengthBindable;
|
||||
bpmSlider.Bindable.BindValueChanged(_ => ChangeHandler?.SaveState());
|
||||
|
||||
bpmTextEntry.Bindable = point.NewValue.BeatLengthBindable;
|
||||
// no need to hook change handler here as it's the same bindable as above
|
||||
|
||||
timeSignature.Bindable = point.NewValue.TimeSignatureBindable;
|
||||
timeSignature.Bindable.BindValueChanged(_ => ChangeHandler?.SaveState());
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,6 +122,8 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
bpmBindable.BindValueChanged(bpm => beatLengthBindable.Value = beatLengthToBpm(bpm.NewValue));
|
||||
|
||||
base.Bindable = bpmBindable;
|
||||
|
||||
TransferValueOnCommit = true;
|
||||
}
|
||||
|
||||
public override Bindable<double> Bindable
|
||||
|
Loading…
Reference in New Issue
Block a user