1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-19 01:42:54 +08:00
osu-lazer/osu.Game/Screens/Play/FailOverlay.cs

37 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.Input;
using OpenTK.Input;
2017-04-02 02:29:17 +08:00
using osu.Game.Graphics;
using OpenTK.Graphics;
2017-04-06 03:51:43 +08:00
using osu.Framework.Allocation;
using System.Linq;
2017-01-27 17:24:49 +08:00
namespace osu.Game.Screens.Play
{
2017-12-18 15:40:50 +08:00
public class FailOverlay : GameplayMenuOverlay
{
2017-04-06 03:36:03 +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());
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (!args.Repeat && args.Key == Key.Escape)
{
2017-12-18 18:13:08 +08:00
InternalButtons.Children.Last().TriggerOnClick();
return true;
}
return base.OnKeyDown(state, args);
}
}
}