CursorOverrideContainer.ShowMenuCursor

This commit is contained in:
TocoToucan
2018-04-11 21:22:52 +03:00
parent 9225c06872
commit d7812ab12e
2 changed files with 15 additions and 10 deletions

View File

@ -21,6 +21,7 @@ namespace osu.Game.Graphics.Cursor
/// Whether any cursors can be displayed.
/// </summary>
public bool CanShowCursor = true;
public bool ShowMenuCursor = true;
public CursorContainer Cursor { get; }
public bool ProvidingUserCursor => true;
@ -53,6 +54,14 @@ namespace osu.Game.Graphics.Cursor
return;
}
if (currentTarget?.Cursor is MenuCursor)
{
if (ShowMenuCursor && currentTarget?.Cursor.State == Visibility.Hidden)
currentTarget?.Cursor?.Show();
else if (!ShowMenuCursor && currentTarget?.Cursor.State == Visibility.Visible)
currentTarget?.Cursor?.Hide();
}
var newTarget = inputManager.HoveredDrawables.OfType<IProvideCursor>().FirstOrDefault(t => t.ProvidingUserCursor) ?? this;
if (currentTarget == newTarget)