diff --git a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinner.cs b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinner.cs index b1d9c453d6..ea57a6a1b5 100644 --- a/osu.Game.Rulesets.Osu.Tests/TestSceneSpinner.cs +++ b/osu.Game.Rulesets.Osu.Tests/TestSceneSpinner.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Testing; using osu.Game.Audio; @@ -26,6 +27,15 @@ namespace osu.Game.Rulesets.Osu.Tests private TestDrawableSpinner drawableSpinner; + private readonly BindableDouble spinRate = new BindableDouble(); + + protected override void LoadComplete() + { + base.LoadComplete(); + + AddSliderStep("Spin rate", 0.5, 5, 1, val => spinRate.Value = val); + } + [TestCase(true)] [TestCase(false)] public void TestVariousSpinners(bool autoplay) @@ -86,7 +96,7 @@ namespace osu.Game.Rulesets.Osu.Tests spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { OverallDifficulty = od }); - return drawableSpinner = new TestDrawableSpinner(spinner, true) + return drawableSpinner = new TestDrawableSpinner(spinner, true, spinRate) { Anchor = Anchor.Centre, Depth = depthIndex++, @@ -114,7 +124,7 @@ namespace osu.Game.Rulesets.Osu.Tests spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize }); - drawableSpinner = new TestDrawableSpinner(spinner, auto) + drawableSpinner = new TestDrawableSpinner(spinner, auto, spinRate) { Anchor = Anchor.Centre, Depth = depthIndex++, @@ -130,18 +140,20 @@ namespace osu.Game.Rulesets.Osu.Tests private partial class TestDrawableSpinner : DrawableSpinner { private readonly bool auto; + private readonly BindableDouble spinRate; - public TestDrawableSpinner(Spinner s, bool auto) + public TestDrawableSpinner(Spinner s, bool auto, BindableDouble spinRate) : base(s) { this.auto = auto; + this.spinRate = spinRate; } protected override void Update() { base.Update(); if (auto) - RotationTracker.AddRotation((float)(Clock.ElapsedFrameTime * 2)); + RotationTracker.AddRotation((float)(Clock.ElapsedFrameTime * spinRate.Value)); } } }