mirror of https://github.com/ppy/osu
allow exiting editor again
This commit is contained in:
parent
addc4ef968
commit
5b26ef75b1
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue