2018-04-13 17:19:50 +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
|
|
|
|
|
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using System.Linq;
|
2018-06-09 15:14:52 +08:00
|
|
|
|
using osu.Framework.Input.Bindings;
|
|
|
|
|
using osu.Game.Input.Bindings;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play
|
|
|
|
|
{
|
2018-06-09 15:14:52 +08:00
|
|
|
|
public class FailOverlay : GameplayMenuOverlay, IKeyBindingHandler<GlobalAction>
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
public override string Header => "failed";
|
|
|
|
|
public override string Description => "you're dead, try again?";
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
AddButton("Retry", colours.YellowDark, () => OnRetry?.Invoke());
|
|
|
|
|
AddButton("Quit", new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
|
|
|
|
|
}
|
2018-06-09 15:14:52 +08:00
|
|
|
|
|
|
|
|
|
public bool OnPressed(GlobalAction action)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-06-09 15:14:52 +08:00
|
|
|
|
if (action == GlobalAction.Back)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
InternalButtons.Children.Last().TriggerOnClick();
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-09 15:14:52 +08:00
|
|
|
|
return false;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
2018-06-09 15:14:52 +08:00
|
|
|
|
|
|
|
|
|
public bool OnReleased(GlobalAction action) => action == GlobalAction.Back;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|