mirror of
https://github.com/ppy/osu.git
synced 2025-02-28 03:15:08 +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]
|
[Resolved]
|
||||||
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; }
|
protected Bindable<ControlPointGroup> SelectedGroup { get; private set; }
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
protected IEditorChangeHandler ChangeHandler { get; private set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
|
@ -37,8 +37,13 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
if (point.NewValue != null)
|
if (point.NewValue != null)
|
||||||
{
|
{
|
||||||
bpmSlider.Bindable = point.NewValue.BeatLengthBindable;
|
bpmSlider.Bindable = point.NewValue.BeatLengthBindable;
|
||||||
|
bpmSlider.Bindable.BindValueChanged(_ => ChangeHandler?.SaveState());
|
||||||
|
|
||||||
bpmTextEntry.Bindable = point.NewValue.BeatLengthBindable;
|
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 = 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));
|
bpmBindable.BindValueChanged(bpm => beatLengthBindable.Value = beatLengthToBpm(bpm.NewValue));
|
||||||
|
|
||||||
base.Bindable = bpmBindable;
|
base.Bindable = bpmBindable;
|
||||||
|
|
||||||
|
TransferValueOnCommit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Bindable<double> Bindable
|
public override Bindable<double> Bindable
|
||||||
|
Loading…
Reference in New Issue
Block a user