From 5b26ef75b173da1c577fc35f6f48da33b4a3c95a Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 30 Jun 2019 12:31:31 +0200 Subject: [PATCH 1/2] allow exiting editor again --- osu.Game/Screens/Edit/Editor.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 660c1235d1..82d820c925 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -24,11 +24,13 @@ using osu.Game.Screens.Edit.Design; using osuTK.Input; using System.Collections.Generic; using osu.Framework; +using osu.Framework.Input.Bindings; +using osu.Game.Input.Bindings; using osu.Game.Users; namespace osu.Game.Screens.Edit { - public class Editor : OsuScreen + public class Editor : OsuScreen, IKeyBindingHandler { protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4"); @@ -206,6 +208,19 @@ namespace osu.Game.Screens.Edit return true; } + public bool OnPressed(GlobalAction action) + { + if (action == GlobalAction.Back) + { + this.Exit(); + return true; + } + + return false; + } + + public bool OnReleased(GlobalAction action) => action == GlobalAction.Back; + public override void OnResuming(IScreen last) { Beatmap.Value.Track?.Stop(); From fa879b4b60603c5c2124fddf2bc1985697dc73a1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 30 Jun 2019 20:46:51 +0900 Subject: [PATCH 2/2] Add a note explaining why manual handling is required --- osu.Game/Screens/Edit/Editor.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 82d820c925..89da9ae063 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -212,6 +212,7 @@ namespace osu.Game.Screens.Edit { if (action == GlobalAction.Back) { + // as we don't want to display the back button, manual handling of exit action is required. this.Exit(); return true; }