2017-02-07 04:59:30 +00:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-03-03 01:17:39 +00:00
|
|
|
|
using osu.Framework.Input;
|
|
|
|
|
using OpenTK.Input;
|
2017-04-01 18:29:17 +00:00
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using OpenTK.Graphics;
|
2017-04-05 19:51:43 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2017-04-13 02:35:36 +00:00
|
|
|
|
using System.Linq;
|
2017-01-27 09:24:49 +00:00
|
|
|
|
|
2017-03-03 01:17:39 +00:00
|
|
|
|
namespace osu.Game.Screens.Play
|
2017-02-02 08:33:39 +00:00
|
|
|
|
{
|
2017-04-06 06:34:52 +00:00
|
|
|
|
public class FailOverlay : MenuOverlay
|
2017-02-02 08:33:39 +00:00
|
|
|
|
{
|
2017-04-05 19:36:03 +00:00
|
|
|
|
public override string Header => "failed";
|
|
|
|
|
public override string Description => "you're dead, try again?";
|
2017-04-13 02:35:36 +00:00
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
AddButton("Retry", colours.YellowDark, OnRetry);
|
|
|
|
|
AddButton("Quit", new Color4(170, 27, 39, 255), OnQuit);
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-02 08:33:39 +00:00
|
|
|
|
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
|
|
|
|
{
|
2017-04-13 02:35:36 +00:00
|
|
|
|
if (!args.Repeat && args.Key == Key.Escape)
|
2017-02-02 08:33:39 +00:00
|
|
|
|
{
|
2017-05-28 09:34:12 +00:00
|
|
|
|
Buttons.Children.Last().TriggerOnClick();
|
2017-02-02 08:33:39 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
2017-02-09 03:46:53 +00:00
|
|
|
|
|
2017-02-02 08:33:39 +00:00
|
|
|
|
return base.OnKeyDown(state, args);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|