Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to disable the ManualInputManager cursor guide #3706

Merged
merged 3 commits into from
Jul 10, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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