mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 12:42:54 +08:00
Use SliderStep instead of TestCaseSliderBar
This greatly simplifies TestCaseKeyCounter and TestCaseHitObject and allows more future automation.
This commit is contained in:
parent
99c54e348c
commit
8c05a40fbf
@ -27,35 +27,13 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
{
|
{
|
||||||
var rateAdjustClock = new StopwatchClock(true);
|
var rateAdjustClock = new StopwatchClock(true);
|
||||||
framedClock = new FramedClock(rateAdjustClock);
|
framedClock = new FramedClock(rateAdjustClock);
|
||||||
playbackSpeed.ValueChanged += delegate { rateAdjustClock.Rate = playbackSpeed.Value; };
|
|
||||||
|
|
||||||
playbackSpeed.TriggerChange();
|
|
||||||
|
|
||||||
AddStep(@"circles", () => loadHitobjects(HitObjectType.Circle));
|
AddStep(@"circles", () => loadHitobjects(HitObjectType.Circle));
|
||||||
AddStep(@"slider", () => loadHitobjects(HitObjectType.Slider));
|
AddStep(@"slider", () => loadHitobjects(HitObjectType.Slider));
|
||||||
AddStep(@"spinner", () => loadHitobjects(HitObjectType.Spinner));
|
AddStep(@"spinner", () => loadHitobjects(HitObjectType.Spinner));
|
||||||
|
|
||||||
AddToggleStep(@"auto", state => { auto = state; loadHitobjects(mode); });
|
AddToggleStep("Auto", state => { auto = state; loadHitobjects(mode); });
|
||||||
|
AddSliderStep("Playback speed", 0.0, 2.0, 0.5, v => rateAdjustClock.Rate = v);
|
||||||
BasicSliderBar<double> sliderBar;
|
|
||||||
Add(new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new SpriteText { Text = "Playback Speed" },
|
|
||||||
sliderBar = new BasicSliderBar<double>
|
|
||||||
{
|
|
||||||
Width = 150,
|
|
||||||
Height = 10,
|
|
||||||
SelectionColor = Color4.Orange,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
sliderBar.Current.BindTo(playbackSpeed);
|
|
||||||
|
|
||||||
framedClock.ProcessFrame();
|
framedClock.ProcessFrame();
|
||||||
|
|
||||||
@ -75,7 +53,6 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
|
|
||||||
private HitObjectType mode = HitObjectType.Slider;
|
private HitObjectType mode = HitObjectType.Slider;
|
||||||
|
|
||||||
private readonly BindableNumber<double> playbackSpeed = new BindableDouble(0.5) { MinValue = 0, MaxValue = 1 };
|
|
||||||
private readonly Container playfieldContainer;
|
private readonly Container playfieldContainer;
|
||||||
private readonly Container approachContainer;
|
private readonly Container approachContainer;
|
||||||
|
|
||||||
|
@ -34,34 +34,13 @@ namespace osu.Desktop.Tests.Visual
|
|||||||
new KeyCounterMouse(MouseButton.Right),
|
new KeyCounterMouse(MouseButton.Right),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
BindableInt bindable = new BindableInt { MinValue = 0, MaxValue = 200, Default = 50 };
|
|
||||||
bindable.ValueChanged += delegate { kc.FadeTime = bindable.Value; };
|
AddStep("Add random", () =>
|
||||||
AddStep("Add Random", () =>
|
|
||||||
{
|
{
|
||||||
Key key = (Key)((int)Key.A + RNG.Next(26));
|
Key key = (Key)((int)Key.A + RNG.Next(26));
|
||||||
kc.Add(new KeyCounterKeyboard(key));
|
kc.Add(new KeyCounterKeyboard(key));
|
||||||
});
|
});
|
||||||
|
AddSliderStep("Fade time", 0, 200, 50, v => kc.FadeTime = v);
|
||||||
TestSliderBar<int> sliderBar;
|
|
||||||
|
|
||||||
Add(new Container
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.Both,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new SpriteText { Text = "FadeTime" },
|
|
||||||
sliderBar = new TestSliderBar<int>
|
|
||||||
{
|
|
||||||
Width = 150,
|
|
||||||
Height = 10,
|
|
||||||
SelectionColor = Color4.Orange,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
sliderBar.Current.BindTo(bindable);
|
|
||||||
|
|
||||||
Add(kc);
|
Add(kc);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user