Merge remote-tracking branch 'upstream/master' into combobreak

This commit is contained in:
Dean Herbert 2019-06-30 21:27:53 +09:00
commit bd54b34538
1 changed files with 17 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,20 @@ protected override bool OnScroll(ScrollEvent e)
return true;
}
public bool OnPressed(GlobalAction action)
{
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;
}
return false;
}
public bool OnReleased(GlobalAction action) => action == GlobalAction.Back;
public override void OnResuming(IScreen last)
{
Beatmap.Value.Track?.Stop();