osu/osu.Game/Screens/Play/FailOverlay.cs

39 lines
1.1 KiB
C#
Raw Normal View History

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using OpenTK.Input;
2017-04-01 18:29:17 +00:00
using osu.Game.Graphics;
using OpenTK.Graphics;
2017-01-27 09:24:49 +00:00
namespace osu.Game.Screens.Play
{
public class FailOverlay : InGameOverlay
{
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Key == Key.Escape)
{
2017-01-31 13:17:47 +00:00
if (State == Visibility.Hidden) return false;
2017-03-28 07:49:58 +00:00
OnQuit();
return true;
}
return base.OnKeyDown(state, args);
}
2017-04-01 18:29:17 +00:00
protected override void AddButtons(OsuColour colours)
{
AddButton(@"Retry", colours.YellowDark, OnRetry);
AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit);
}
public FailOverlay()
{
2017-04-01 18:50:25 +00:00
Title = @"failed";
Description = @"you're dead, try again?";
}
}
}