mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 01:53:00 +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.Configuration;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Graphics.Cursor;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Overlays;
|
||||
@ -42,6 +43,8 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
protected override bool CreateNestedActionContainer => false;
|
||||
|
||||
protected override bool DisplayCursorForManualInput => false;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
@ -119,6 +122,8 @@ namespace osu.Game.Tests.Visual
|
||||
|
||||
public RealmAccess Realm => Dependencies.Get<RealmAccess>();
|
||||
|
||||
public new GlobalCursorDisplay GlobalCursorDisplay => base.GlobalCursorDisplay;
|
||||
|
||||
public new BackButton BackButton => base.BackButton;
|
||||
|
||||
public new BeatmapManager BeatmapManager => base.BeatmapManager;
|
||||
|
@ -36,21 +36,31 @@ namespace osu.Game.Tests.Visual
|
||||
/// </summary>
|
||||
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()
|
||||
{
|
||||
GlobalCursorDisplay cursorDisplay;
|
||||
var mainContent = content = new Container { RelativeSizeAxes = Axes.Both };
|
||||
|
||||
CompositeDrawable mainContent = cursorDisplay = new GlobalCursorDisplay { RelativeSizeAxes = Axes.Both };
|
||||
|
||||
cursorDisplay.Child = content = new OsuTooltipContainer(cursorDisplay.MenuCursor)
|
||||
if (DisplayCursorForManualInput)
|
||||
{
|
||||
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)
|
||||
{
|
||||
mainContent = new GlobalActionContainer(null).WithChild(mainContent);
|
||||
}
|
||||
|
||||
base.Content.AddRange(new Drawable[]
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user