mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 07:22:54 +08:00
Hide manual input manager cursor in OsuGameTestScene
s
Allows checking that the cursor is actually hidden in `TestSceneOsuGame.TestCursorHidesWhenIdle`.
This commit is contained in:
parent
45f590ca43
commit
241ecb63a1
@ -17,6 +17,7 @@ using osu.Framework.Testing;
|
|||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
|
using osu.Game.Graphics.Cursor;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
@ -42,6 +43,8 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
protected override bool CreateNestedActionContainer => false;
|
protected override bool CreateNestedActionContainer => false;
|
||||||
|
|
||||||
|
protected override bool DisplayCursorForManualInput => false;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -119,6 +122,8 @@ namespace osu.Game.Tests.Visual
|
|||||||
|
|
||||||
public RealmAccess Realm => Dependencies.Get<RealmAccess>();
|
public RealmAccess Realm => Dependencies.Get<RealmAccess>();
|
||||||
|
|
||||||
|
public new GlobalCursorDisplay GlobalCursorDisplay => base.GlobalCursorDisplay;
|
||||||
|
|
||||||
public new BackButton BackButton => base.BackButton;
|
public new BackButton BackButton => base.BackButton;
|
||||||
|
|
||||||
public new BeatmapManager BeatmapManager => base.BeatmapManager;
|
public new BeatmapManager BeatmapManager => base.BeatmapManager;
|
||||||
|
@ -36,21 +36,31 @@ namespace osu.Game.Tests.Visual
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual bool CreateNestedActionContainer => true;
|
protected virtual bool CreateNestedActionContainer => true;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether a menu cursor controlled by the manual input manager should be displayed.
|
||||||
|
/// True by default, but is disabled for <see cref="OsuGameTestScene"/>s as they provide their own global cursor.
|
||||||
|
/// </summary>
|
||||||
|
protected virtual bool DisplayCursorForManualInput => true;
|
||||||
|
|
||||||
protected OsuManualInputManagerTestScene()
|
protected OsuManualInputManagerTestScene()
|
||||||
{
|
{
|
||||||
GlobalCursorDisplay cursorDisplay;
|
var mainContent = content = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
CompositeDrawable mainContent = cursorDisplay = new GlobalCursorDisplay { RelativeSizeAxes = Axes.Both };
|
if (DisplayCursorForManualInput)
|
||||||
|
|
||||||
cursorDisplay.Child = content = new OsuTooltipContainer(cursorDisplay.MenuCursor)
|
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both
|
var cursorDisplay = new GlobalCursorDisplay { RelativeSizeAxes = Axes.Both };
|
||||||
};
|
|
||||||
|
cursorDisplay.Add(new OsuTooltipContainer(cursorDisplay.MenuCursor)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Child = mainContent
|
||||||
|
});
|
||||||
|
|
||||||
|
mainContent = cursorDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
if (CreateNestedActionContainer)
|
if (CreateNestedActionContainer)
|
||||||
{
|
|
||||||
mainContent = new GlobalActionContainer(null).WithChild(mainContent);
|
mainContent = new GlobalActionContainer(null).WithChild(mainContent);
|
||||||
}
|
|
||||||
|
|
||||||
base.Content.AddRange(new Drawable[]
|
base.Content.AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user