mirror of
https://github.com/ppy/osu.git
synced 2025-01-07 17:52:54 +08:00
Function of add random.
This commit is contained in:
parent
92c21d8b12
commit
63ba3455fb
@ -10,6 +10,7 @@ using osu.Framework.Graphics.UserInterface;
|
|||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
|
|
||||||
namespace osu.Desktop.VisualTests.Tests
|
namespace osu.Desktop.VisualTests.Tests
|
||||||
{
|
{
|
||||||
@ -23,20 +24,7 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
|
||||||
KeyCounterCollection kc;
|
KeyCounterCollection kc = new KeyCounterCollection
|
||||||
BindableInt bindable = new BindableInt { MinValue = 0, MaxValue = 1000, Default = 50 };
|
|
||||||
AddButton("Add Random", null);
|
|
||||||
Add(new SliderBar<int>
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Anchor = Anchor.TopLeft,
|
|
||||||
Width = 150,
|
|
||||||
Height = 10,
|
|
||||||
SelectionColor = Color4.Orange,
|
|
||||||
Position = new Vector2(0, 50),
|
|
||||||
Bindable = bindable
|
|
||||||
});
|
|
||||||
Add(kc = new KeyCounterCollection
|
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -48,7 +36,24 @@ namespace osu.Desktop.VisualTests.Tests
|
|||||||
new KeyCounterMouse(@"M1", MouseButton.Left),
|
new KeyCounterMouse(@"M1", MouseButton.Left),
|
||||||
new KeyCounterMouse(@"M2", MouseButton.Right),
|
new KeyCounterMouse(@"M2", MouseButton.Right),
|
||||||
},
|
},
|
||||||
|
};
|
||||||
|
BindableInt bindable = new BindableInt { MinValue = 0, MaxValue = 1000, Default = 50 };
|
||||||
|
AddButton("Add Random", () =>
|
||||||
|
{
|
||||||
|
Key key = (Key)((int)Key.A + RNG.Next(26));
|
||||||
|
kc.Add(new KeyCounterKeyboard(key.ToString(), key));
|
||||||
});
|
});
|
||||||
|
Add(new SliderBar<int>
|
||||||
|
{
|
||||||
|
Origin = Anchor.TopLeft,
|
||||||
|
Anchor = Anchor.TopLeft,
|
||||||
|
Width = 150,
|
||||||
|
Height = 10,
|
||||||
|
SelectionColor = Color4.Orange,
|
||||||
|
Position = new Vector2(0, 50),
|
||||||
|
Bindable = bindable
|
||||||
|
});
|
||||||
|
Add(kc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user