osu/osu.Game/Screens/Play/PauseOverlay.cs

41 lines
1.2 KiB
C#
Raw Normal View History

2017-03-28 07:49:58 +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
using System;
using System.Linq;
2017-03-28 07:49:58 +00:00
using osu.Framework.Input;
using osu.Game.Graphics;
using OpenTK.Input;
using OpenTK.Graphics;
2017-04-05 19:51:43 +00:00
using osu.Framework.Allocation;
2017-03-28 07:49:58 +00:00
namespace osu.Game.Screens.Play
{
2017-04-06 06:34:52 +00:00
public class PauseOverlay : MenuOverlay
2017-03-28 07:49:58 +00:00
{
public Action OnResume;
2017-04-05 19:36:03 +00:00
public override string Header => "paused";
public override string Description => "you're not going to do what i think you're going to do, are ya?";
2017-03-28 07:49:58 +00:00
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
{
if (!args.Repeat && args.Key == Key.Escape)
2017-03-28 07:49:58 +00:00
{
Buttons.Children.First().TriggerClick();
2017-03-28 07:49:58 +00:00
return true;
}
return base.OnKeyDown(state, args);
}
2017-04-05 19:51:43 +00:00
[BackgroundDependencyLoader]
private void load(OsuColour colours)
2017-03-28 07:49:58 +00:00
{
2017-04-06 06:31:21 +00:00
AddButton("Continue", colours.Green, OnResume);
AddButton("Retry", colours.YellowDark, OnRetry);
AddButton("Quit", new Color4(170, 27, 39, 255), OnQuit);
2017-03-28 07:49:58 +00:00
}
}
}