From b6fd5b0f17ca5e3f0c6fd8bbf35359eb171ccc60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 21 Dec 2017 13:58:24 +0900 Subject: [PATCH 1/2] Fix keyboard and mouse input not properly getting blocked by GameplayMenuOverlay --- .../Bindings/GlobalKeyBindingInputManager.cs | 3 +- osu.Game/Screens/Play/GameplayMenuOverlay.cs | 37 ++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs index 759396e195..745508ec9e 100644 --- a/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs +++ b/osu.Game/Input/Bindings/GlobalKeyBindingInputManager.cs @@ -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 + public class GlobalKeyBindingInputManager : DatabasedKeyBindingInputManager, IHandleGlobalInput { private readonly Drawable handler; diff --git a/osu.Game/Screens/Play/GameplayMenuOverlay.cs b/osu.Game/Screens/Play/GameplayMenuOverlay.cs index 182c4efe89..e49ebb5590 100644 --- a/osu.Game/Screens/Play/GameplayMenuOverlay.cs +++ b/osu.Game/Screens/Play/GameplayMenuOverlay.cs @@ -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) From fdd218c64189e25a8eb68d89cfee136431a1d8e0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 21 Dec 2017 20:11:00 +0900 Subject: [PATCH 2/2] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 28fbd0711c..f4fde31f8c 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 28fbd0711c09d3b06b51fc728b025f83ded2f0f8 +Subproject commit f4fde31f8c09305d2130064da2f7bae995be8286