allow exiting editor again

This commit is contained in:
Unknown
2019-06-30 12:31:31 +02:00
parent addc4ef968
commit 5b26ef75b1

View File

@ -24,11 +24,13 @@ using osu.Game.Screens.Edit.Design;
using osuTK.Input; using osuTK.Input;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework; using osu.Framework;
using osu.Framework.Input.Bindings;
using osu.Game.Input.Bindings;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Screens.Edit namespace osu.Game.Screens.Edit
{ {
public class Editor : OsuScreen public class Editor : OsuScreen, IKeyBindingHandler<GlobalAction>
{ {
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4"); protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
@ -206,6 +208,19 @@ namespace osu.Game.Screens.Edit
return true; 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) public override void OnResuming(IScreen last)
{ {
Beatmap.Value.Track?.Stop(); Beatmap.Value.Track?.Stop();