2018-05-10 16:07:19 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
2018-06-27 15:06:26 +08:00
|
|
|
using osu.Framework.Input.Bindings;
|
|
|
|
using osu.Game.Input.Bindings;
|
2018-05-10 16:07:19 +08:00
|
|
|
using osu.Game.Overlays;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Menu
|
|
|
|
{
|
2018-06-27 15:06:26 +08:00
|
|
|
public class ExitConfirmOverlay : HoldToConfirmOverlay, IKeyBindingHandler<GlobalAction>
|
2018-05-10 16:07:19 +08:00
|
|
|
{
|
2018-06-27 15:06:26 +08:00
|
|
|
public bool OnPressed(GlobalAction action)
|
2018-05-10 16:07:19 +08:00
|
|
|
{
|
2018-06-27 15:06:26 +08:00
|
|
|
if (action == GlobalAction.Back)
|
2018-05-10 16:07:19 +08:00
|
|
|
{
|
|
|
|
BeginConfirm();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-06-27 15:06:26 +08:00
|
|
|
return false;
|
2018-05-10 16:07:19 +08:00
|
|
|
}
|
|
|
|
|
2018-06-27 15:06:26 +08:00
|
|
|
public bool OnReleased(GlobalAction action)
|
2018-05-10 16:07:19 +08:00
|
|
|
{
|
2018-06-27 15:06:26 +08:00
|
|
|
if (action == GlobalAction.Back)
|
2018-05-10 16:07:19 +08:00
|
|
|
{
|
|
|
|
AbortConfirm();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-06-27 15:06:26 +08:00
|
|
|
return false;
|
2018-05-10 16:07:19 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|