mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Use SliderStep instead of TestCaseSliderBar
This greatly simplifies TestCaseKeyCounter and TestCaseHitObject and allows more future automation.
This commit is contained in:
@ -34,34 +34,13 @@ namespace osu.Desktop.Tests.Visual
|
||||
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));
|
||||
kc.Add(new KeyCounterKeyboard(key));
|
||||
});
|
||||
|
||||
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);
|
||||
AddSliderStep("Fade time", 0, 200, 50, v => kc.FadeTime = v);
|
||||
|
||||
Add(kc);
|
||||
}
|
||||
|
Reference in New Issue
Block a user