1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 19:27:26 +08:00
osu-lazer/osu.Game/Screens/Play/PauseOverlay.cs
Andrey Zavadskiy 85c2184170 Fixes
2017-03-28 11:33:56 +03:00

37 lines
1.1 KiB
C#

// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Input;
using osu.Game.Graphics;
using OpenTK.Input;
using osu.Framework.Graphics.Containers;
using OpenTK.Graphics;
namespace osu.Game.Screens.Play
{
public class PauseOverlay : FailOverlay
{
public Action OnResume;
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (args.Key == Key.Escape)
{
if (State == Visibility.Hidden) return false;
OnResume();
return true;
}
return base.OnKeyDown(state, args);
}
protected override void AddButtons(OsuColour colours)
{
AddButton(@"Continue", colours.Green, OnResume);
AddButton(@"Retry", colours.YellowDark, OnRetry);
AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit);
}
}
}