diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs index babe39c41d..ddb6000fbb 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseHitCircle.cs @@ -27,7 +27,7 @@ public class TestCaseHitCircle : OsuTestCase private bool hidden; private int depthIndex; private int circleSize; - private float circleScale; + private float circleScale = 1; public TestCaseHitCircle() { diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs index 224e2ea3ef..8b2eb8baef 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSlider.cs @@ -30,7 +30,7 @@ public class TestCaseSlider : OsuTestCase private int repeats; private int depthIndex; private int circleSize; - private float circleScale; + private float circleScale = 1; private double speedMultiplier = 2; private double sliderMultiplier = 2; diff --git a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs index 76cc70effd..4f97ba9697 100644 --- a/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs +++ b/osu.Game.Rulesets.Osu/Tests/TestCaseSpinner.cs @@ -2,10 +2,13 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using NUnit.Framework; +using OpenTK; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Rulesets.Osu.Mods; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.Osu.Objects.Drawables; using osu.Game.Tests.Visual; @@ -18,28 +21,43 @@ public class TestCaseSpinner : OsuTestCase private readonly Container content; protected override Container Content => content; + private bool hidden; private int depthIndex; + private int circleSize; + private float circleScale = 1; public TestCaseSpinner() { base.Content.Add(content = new OsuInputManager(new RulesetInfo { ID = 0 })); - AddStep("Single", addSingle); + AddStep("Single", testSingle); + AddToggleStep("Hidden", v => hidden = v); + AddSliderStep("CircleSize", 0, 10, 0, s => circleSize = s); + AddSliderStep("CircleScale", 0.5f, 2, 1, s => circleScale = s); } - private void addSingle() + private void testSingle() { var spinner = new Spinner { StartTime = Time.Current + 1000, EndTime = Time.Current + 4000 }; - spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = 0 }); + spinner.ApplyDefaults(new ControlPointInfo(), new BeatmapDifficulty { CircleSize = circleSize }); var drawable = new DrawableSpinner(spinner) { Anchor = Anchor.Centre, + Scale = new Vector2(circleScale), Depth = depthIndex++ }; + if (hidden) + drawable.ApplyCustomUpdateState += new TestOsuModHidden().CustomSequence; + Add(drawable); } + + private class TestOsuModHidden : OsuModHidden + { + public new void CustomSequence(DrawableHitObject drawable, ArmedState state) => base.CustomSequence(drawable, state); + } } }