From 8220a513102a6128fc6e3c11383b365029b4aa4f Mon Sep 17 00:00:00 2001 From: David Zhao Date: Tue, 23 Jul 2019 17:59:50 +0900 Subject: [PATCH 1/7] Make backbutton handle global input last --- osu.Game/Input/Bindings/GlobalActionContainer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Input/Bindings/GlobalActionContainer.cs b/osu.Game/Input/Bindings/GlobalActionContainer.cs index 669fd62e45..ff006efdd6 100644 --- a/osu.Game/Input/Bindings/GlobalActionContainer.cs +++ b/osu.Game/Input/Bindings/GlobalActionContainer.cs @@ -7,6 +7,7 @@ using System.Linq; using osu.Framework.Graphics; using osu.Framework.Input; using osu.Framework.Input.Bindings; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Input.Bindings { @@ -55,8 +56,11 @@ namespace osu.Game.Input.Bindings new KeyBinding(new[] { InputKey.Control, InputKey.Minus }, GlobalAction.DecreaseScrollSpeed), }; + /// + /// Make sure that the handles global input first, and that handles global input last. + /// protected override IEnumerable KeyBindingInputQueue => - handler == null ? base.KeyBindingInputQueue : base.KeyBindingInputQueue.Prepend(handler); + (handler == null ? base.KeyBindingInputQueue : base.KeyBindingInputQueue.Prepend(handler)).OrderBy(d => d is BackButton); } public enum GlobalAction From 38559685a96ec763291aff3bed423696462b69cf Mon Sep 17 00:00:00 2001 From: David Zhao Date: Wed, 24 Jul 2019 12:47:41 +0900 Subject: [PATCH 2/7] proxy backbutton instead --- osu.Game/OsuGame.cs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 2a484fc122..4c7fc688ab 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -394,6 +394,16 @@ namespace osu.Game AddRange(new Drawable[] { + backButton = new BackButton + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Action = () => + { + if ((screenStack.CurrentScreen as IOsuScreen)?.AllowBackButton == true) + screenStack.Exit(); + } + }, new VolumeControlReceptor { RelativeSizeAxes = Axes.Both, @@ -403,19 +413,10 @@ namespace osu.Game screenContainer = new ScalingContainer(ScalingMode.ExcludeOverlays) { RelativeSizeAxes = Axes.Both, - Children = new Drawable[] + Children = new[] { screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }, - backButton = new BackButton - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - Action = () => - { - if ((screenStack.CurrentScreen as IOsuScreen)?.AllowBackButton == true) - screenStack.Exit(); - } - }, + backButton.CreateProxy(), logoContainer = new Container { RelativeSizeAxes = Axes.Both }, } }, From da3dc610baf632279149814ac500f7d47883c4d3 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Wed, 24 Jul 2019 12:52:18 +0900 Subject: [PATCH 3/7] revert globalaction changes --- osu.Game/Input/Bindings/GlobalActionContainer.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/osu.Game/Input/Bindings/GlobalActionContainer.cs b/osu.Game/Input/Bindings/GlobalActionContainer.cs index ff006efdd6..669fd62e45 100644 --- a/osu.Game/Input/Bindings/GlobalActionContainer.cs +++ b/osu.Game/Input/Bindings/GlobalActionContainer.cs @@ -7,7 +7,6 @@ using System.Linq; using osu.Framework.Graphics; using osu.Framework.Input; using osu.Framework.Input.Bindings; -using osu.Game.Graphics.UserInterface; namespace osu.Game.Input.Bindings { @@ -56,11 +55,8 @@ namespace osu.Game.Input.Bindings new KeyBinding(new[] { InputKey.Control, InputKey.Minus }, GlobalAction.DecreaseScrollSpeed), }; - /// - /// Make sure that the handles global input first, and that handles global input last. - /// protected override IEnumerable KeyBindingInputQueue => - (handler == null ? base.KeyBindingInputQueue : base.KeyBindingInputQueue.Prepend(handler)).OrderBy(d => d is BackButton); + handler == null ? base.KeyBindingInputQueue : base.KeyBindingInputQueue.Prepend(handler); } public enum GlobalAction From bbcc8f072116e52e5105bc241166a4396d3b9af5 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 25 Jul 2019 11:11:20 +0900 Subject: [PATCH 4/7] Add new container level and unblock footer --- osu.Game/OsuGame.cs | 33 +++++++++++++++++++------------ osu.Game/Screens/Select/Footer.cs | 4 ++-- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 6fb76c640f..a248da4304 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -395,16 +395,6 @@ namespace osu.Game AddRange(new Drawable[] { - backButton = new BackButton - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - Action = () => - { - if ((screenStack.CurrentScreen as IOsuScreen)?.AllowBackButton == true) - screenStack.Exit(); - } - }, new VolumeControlReceptor { RelativeSizeAxes = Axes.Both, @@ -416,9 +406,26 @@ namespace osu.Game RelativeSizeAxes = Axes.Both, Children = new[] { - screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }, - backButton.CreateProxy(), - logoContainer = new Container { RelativeSizeAxes = Axes.Both }, + backButton = new BackButton + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Action = () => + { + if ((screenStack.CurrentScreen as IOsuScreen)?.AllowBackButton == true) + screenStack.Exit(); + } + }, + new Container + { + RelativeSizeAxes = Axes.Both, + Children = new[] + { + screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }, + backButton.CreateProxy(), + logoContainer = new Container { RelativeSizeAxes = Axes.Both }, + } + } } }, overlayContent = new Container { RelativeSizeAxes = Axes.Both }, diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 0680711f1c..0043acb818 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -104,8 +104,8 @@ namespace osu.Game.Screens.Select updateModeLight(); } - protected override bool OnMouseDown(MouseDownEvent e) => true; + protected override bool OnMouseDown(MouseDownEvent e) => false; - protected override bool OnClick(ClickEvent e) => true; + protected override bool OnClick(ClickEvent e) => false; } } From e63c97b306b712db8b2159d8bfd3acef76006e81 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 25 Jul 2019 11:20:24 +0900 Subject: [PATCH 5/7] remove unnecessary overrides --- osu.Game/Screens/Select/Footer.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 0043acb818..a1384f19b4 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -103,9 +103,5 @@ namespace osu.Game.Screens.Select updateModeLight(); } - - protected override bool OnMouseDown(MouseDownEvent e) => false; - - protected override bool OnClick(ClickEvent e) => false; } } From 6ef3c71e22c430039cdfab297a0095bfc48a20a6 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 25 Jul 2019 11:31:46 +0900 Subject: [PATCH 6/7] remove unused using --- osu.Game/Screens/Select/Footer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index a1384f19b4..71641cab5d 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -9,7 +9,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input.Events; using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Select From bd2fce4bb7997dde45486bd0ff2cbecbcdce6826 Mon Sep 17 00:00:00 2001 From: David Zhao Date: Sun, 28 Jul 2019 13:45:54 +0900 Subject: [PATCH 7/7] don't use extra container --- osu.Game/OsuGame.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index e71344738b..e5099f3c2f 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -416,16 +416,9 @@ namespace osu.Game screenStack.Exit(); } }, - new Container - { - RelativeSizeAxes = Axes.Both, - Children = new[] - { - screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }, - backButton.CreateProxy(), - logoContainer = new Container { RelativeSizeAxes = Axes.Both }, - } - } + screenStack = new OsuScreenStack { RelativeSizeAxes = Axes.Both }, + backButton.CreateProxy(), + logoContainer = new Container { RelativeSizeAxes = Axes.Both }, } }, overlayContent = new Container { RelativeSizeAxes = Axes.Both },