mirror of
https://github.com/ppy/osu
synced 2024-12-14 19:06:07 +00:00
Merge pull request #1711 from peppy/fix-gameplay-menu-blocking
Fix keyboard and mouse input not properly getting blocked by GameplayMenuOverlay
This commit is contained in:
commit
28cc125d86
@ -1 +1 @@
|
||||
Subproject commit 28fbd0711c09d3b06b51fc728b025f83ded2f0f8
|
||||
Subproject commit f4fde31f8c09305d2130064da2f7bae995be8286
|
@ -5,11 +5,12 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Bindings;
|
||||
|
||||
namespace osu.Game.Input.Bindings
|
||||
{
|
||||
public class GlobalKeyBindingInputManager : DatabasedKeyBindingInputManager<GlobalAction>
|
||||
public class GlobalKeyBindingInputManager : DatabasedKeyBindingInputManager<GlobalAction>, IHandleGlobalInput
|
||||
{
|
||||
private readonly Drawable handler;
|
||||
|
||||
|
@ -26,6 +26,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override bool BlockPassThroughKeyboard => true;
|
||||
|
||||
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
|
||||
|
||||
public Action OnRetry;
|
||||
public Action OnQuit;
|
||||
|
||||
@ -197,6 +199,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
|
||||
private int _selectionIndex = -1;
|
||||
|
||||
private int selectionIndex
|
||||
{
|
||||
get { return _selectionIndex; }
|
||||
@ -219,26 +222,26 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Repeat)
|
||||
return false;
|
||||
|
||||
switch (args.Key)
|
||||
if (!args.Repeat)
|
||||
{
|
||||
case Key.Up:
|
||||
if (selectionIndex == -1 || selectionIndex == 0)
|
||||
selectionIndex = InternalButtons.Count - 1;
|
||||
else
|
||||
selectionIndex--;
|
||||
return true;
|
||||
case Key.Down:
|
||||
if (selectionIndex == -1 || selectionIndex == InternalButtons.Count - 1)
|
||||
selectionIndex = 0;
|
||||
else
|
||||
selectionIndex++;
|
||||
return true;
|
||||
switch (args.Key)
|
||||
{
|
||||
case Key.Up:
|
||||
if (selectionIndex == -1 || selectionIndex == 0)
|
||||
selectionIndex = InternalButtons.Count - 1;
|
||||
else
|
||||
selectionIndex--;
|
||||
return true;
|
||||
case Key.Down:
|
||||
if (selectionIndex == -1 || selectionIndex == InternalButtons.Count - 1)
|
||||
selectionIndex = 0;
|
||||
else
|
||||
selectionIndex++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return base.OnKeyDown(state, args);
|
||||
}
|
||||
|
||||
private void buttonSelectionChanged(DialogButton button, bool isSelected)
|
||||
|
Loading…
Reference in New Issue
Block a user