2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Testing.Input;
|
2019-04-23 12:32:44 +08:00
|
|
|
|
using osu.Game.Graphics.Cursor;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual
|
|
|
|
|
{
|
2019-05-15 03:37:25 +08:00
|
|
|
|
public abstract class ManualInputManagerTestScene : OsuTestScene
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-04-23 12:32:44 +08:00
|
|
|
|
protected override Container<Drawable> Content => content;
|
|
|
|
|
private readonly Container content;
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
protected readonly ManualInputManager InputManager;
|
|
|
|
|
|
2019-05-15 03:37:25 +08:00
|
|
|
|
protected ManualInputManagerTestScene()
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-04-23 12:32:44 +08:00
|
|
|
|
base.Content.Add(InputManager = new ManualInputManager
|
|
|
|
|
{
|
|
|
|
|
UseParentInput = true,
|
|
|
|
|
Child = content = new MenuCursorContainer { RelativeSizeAxes = Axes.Both },
|
|
|
|
|
});
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns input back to the user.
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected void ReturnUserInput()
|
|
|
|
|
{
|
2018-06-11 22:00:26 +08:00
|
|
|
|
AddStep("Return user input", () => InputManager.UseParentInput = true);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|