1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-18 01:02:55 +08:00
osu-lazer/osu.Game/Tests/Visual/ManualInputManagerTestCase.cs
Dean Herbert 868367511e Add ManualInputManager to screen tests
Also sanitises content init order (ctor for content; bdl for other)
2019-03-26 13:26:55 +09:00

29 lines
905 B
C#

// 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.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing.Input;
namespace osu.Game.Tests.Visual
{
public abstract class ManualInputManagerTestCase : OsuTestCase
{
protected override Container<Drawable> Content => InputManager;
protected readonly ManualInputManager InputManager;
protected ManualInputManagerTestCase()
{
base.Content.Add(InputManager = new ManualInputManager { UseParentInput = true });
}
/// <summary>
/// Returns input back to the user.
/// </summary>
protected void ReturnUserInput()
{
AddStep("Return user input", () => InputManager.UseParentInput = true);
}
}
}