1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 06:02:55 +08:00
osu-lazer/osu.Desktop.Tests/Visual/TestCaseKeyCounter.cs

42 lines
1.3 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.MathUtils;
2017-01-27 20:57:22 +08:00
using osu.Game.Screens.Play;
using OpenTK.Input;
2016-09-24 08:57:13 +08:00
namespace osu.Desktop.Tests.Visual
2016-09-24 08:57:13 +08:00
{
internal class TestCaseKeyCounter : OsuTestCase
2016-09-24 08:57:13 +08:00
{
public override string Description => @"Tests key counter";
public TestCaseKeyCounter()
2016-09-24 08:57:13 +08:00
{
2016-12-05 01:03:18 +08:00
KeyCounterCollection kc = new KeyCounterCollection
2016-12-05 00:58:52 +08:00
{
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
IsCounting = true,
Children = new KeyCounter[]
{
new KeyCounterKeyboard(Key.Z),
new KeyCounterKeyboard(Key.X),
new KeyCounterMouse(MouseButton.Left),
new KeyCounterMouse(MouseButton.Right),
},
2016-12-05 01:03:18 +08:00
};
AddStep("Add random", () =>
2016-12-05 01:03:18 +08:00
{
Key key = (Key)((int)Key.A + RNG.Next(26));
kc.Add(new KeyCounterKeyboard(key));
2016-12-05 01:03:18 +08:00
});
AddSliderStep("Fade time", 0, 200, 50, v => kc.FadeTime = v);
2017-04-10 16:10:15 +08:00
2016-12-05 01:03:18 +08:00
Add(kc);
2016-09-24 08:57:13 +08:00
}
}
}