allow exiting editor again

This commit is contained in:
Unknown 2019-06-30 12:31:31 +02:00
parent addc4ef968
commit 5b26ef75b1
1 changed files with 16 additions and 1 deletions

View File

@ -24,11 +24,13 @@
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<GlobalAction>
{
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
@ -206,6 +208,19 @@ protected override bool OnScroll(ScrollEvent e)
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();