mirror of
https://github.com/ppy/osu.git
synced 2025-02-10 08:52:54 +08:00
Add step for adjusting editor clock rate in test scene
This commit is contained in:
parent
e12d188dad
commit
2fac710d4b
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Audio;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -24,6 +25,8 @@ namespace osu.Game.Tests.Visual
|
|||||||
[Cached]
|
[Cached]
|
||||||
protected new readonly EditorClock Clock;
|
protected new readonly EditorClock Clock;
|
||||||
|
|
||||||
|
private readonly Bindable<double> frequencyAdjustment = new BindableDouble(1);
|
||||||
|
|
||||||
protected virtual bool ScrollUsingMouseWheel => true;
|
protected virtual bool ScrollUsingMouseWheel => true;
|
||||||
|
|
||||||
protected EditorClockTestScene()
|
protected EditorClockTestScene()
|
||||||
@ -44,14 +47,21 @@ namespace osu.Game.Tests.Visual
|
|||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
Beatmap.BindValueChanged(beatmapChanged, true);
|
Beatmap.BindValueChanged(beatmapChanged, true);
|
||||||
|
|
||||||
|
AddSliderStep("editor clock rate", 0.0, 2.0, 1.0, v => frequencyAdjustment.Value = v);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void beatmapChanged(ValueChangedEvent<WorkingBeatmap> e)
|
private void beatmapChanged(ValueChangedEvent<WorkingBeatmap> e)
|
||||||
{
|
{
|
||||||
|
e.OldValue?.Track.RemoveAdjustment(AdjustableProperty.Frequency, frequencyAdjustment);
|
||||||
|
|
||||||
Clock.Beatmap = e.NewValue.Beatmap;
|
Clock.Beatmap = e.NewValue.Beatmap;
|
||||||
Clock.ChangeSource(e.NewValue.Track);
|
Clock.ChangeSource(e.NewValue.Track);
|
||||||
Clock.ProcessFrame();
|
Clock.ProcessFrame();
|
||||||
|
|
||||||
|
e.NewValue.Track.AddAdjustment(AdjustableProperty.Frequency, frequencyAdjustment);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
Loading…
Reference in New Issue
Block a user