Fix gameplay cursor being hidden in tests/replays (#4667)

Fix gameplay cursor being hidden in tests/replays
This commit is contained in:
Dean Herbert 2019-04-23 13:54:44 +09:00 committed by GitHub
commit 3bfd2a4d2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -225,6 +225,12 @@ public override void SetReplayScore(Score replayScore)
if (replayInputManager.ReplayInputHandler != null)
replayInputManager.ReplayInputHandler.GamefieldToScreenSpace = Playfield.GamefieldToScreenSpace;
if (!ProvidingUserCursor)
{
// The cursor is hidden by default (see Playfield.load()), but should be shown when there's a replay
Playfield.Cursor?.Show();
}
}
/// <summary>

View File

@ -4,17 +4,24 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing.Input;
using osu.Game.Graphics.Cursor;
namespace osu.Game.Tests.Visual
{
public abstract class ManualInputManagerTestCase : OsuTestCase
{
protected override Container<Drawable> Content => InputManager;
protected override Container<Drawable> Content => content;
private readonly Container content;
protected readonly ManualInputManager InputManager;
protected ManualInputManagerTestCase()
{
base.Content.Add(InputManager = new ManualInputManager { UseParentInput = true });
base.Content.Add(InputManager = new ManualInputManager
{
UseParentInput = true,
Child = content = new MenuCursorContainer { RelativeSizeAxes = Axes.Both },
});
}
/// <summary>