Skip to content

Commit

Permalink
Merge pull request #3706 from peppy/manual-input-manager-test-cursor-…
Browse files Browse the repository at this point in the history
…toggle

Add the ability to disable the ManualInputManager cursor guide
  • Loading branch information
smoogipoo committed Jul 10, 2020
2 parents 878190a + eefa9b1 commit 19f30a2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion osu.Framework/Testing/Input/ManualInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,29 @@ public class ManualInputManager : PassThroughInputManager

protected override Container<Drawable> Content => content;

private bool showVisualCursorGuide = true;

/// <summary>
/// Whether to show a visible cursor tracking position and clicks.
/// Generally should be enabled unless it blocks the test's content.
/// </summary>
public bool ShowVisualCursorGuide
{
get => showVisualCursorGuide;
set
{
if (value == showVisualCursorGuide)
return;

showVisualCursorGuide = value;
testCursor.State.Value = value ? Visibility.Visible : Visibility.Hidden;
}
}

private readonly Container content;

private readonly TestCursorContainer testCursor;

public ManualInputManager()
{
UseParentInput = true;
Expand All @@ -33,7 +54,7 @@ public ManualInputManager()
InternalChildren = new Drawable[]
{
content = new Container { RelativeSizeAxes = Axes.Both },
new TestCursorContainer(),
testCursor = new TestCursorContainer(),
};
}

Expand Down

0 comments on commit 19f30a2

Please sign in to comment.