mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:52:55 +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.
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Beatmaps;
|
||||
@ -24,6 +25,8 @@ namespace osu.Game.Tests.Visual
|
||||
[Cached]
|
||||
protected new readonly EditorClock Clock;
|
||||
|
||||
private readonly Bindable<double> frequencyAdjustment = new BindableDouble(1);
|
||||
|
||||
protected virtual bool ScrollUsingMouseWheel => true;
|
||||
|
||||
protected EditorClockTestScene()
|
||||
@ -44,14 +47,21 @@ namespace osu.Game.Tests.Visual
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
Beatmap.BindValueChanged(beatmapChanged, true);
|
||||
|
||||
AddSliderStep("editor clock rate", 0.0, 2.0, 1.0, v => frequencyAdjustment.Value = v);
|
||||
}
|
||||
|
||||
private void beatmapChanged(ValueChangedEvent<WorkingBeatmap> e)
|
||||
{
|
||||
e.OldValue?.Track.RemoveAdjustment(AdjustableProperty.Frequency, frequencyAdjustment);
|
||||
|
||||
Clock.Beatmap = e.NewValue.Beatmap;
|
||||
Clock.ChangeSource(e.NewValue.Track);
|
||||
Clock.ProcessFrame();
|
||||
|
||||
e.NewValue.Track.AddAdjustment(AdjustableProperty.Frequency, frequencyAdjustment);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
Loading…
Reference in New Issue
Block a user