2017-03-28 15:49:58 +08: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 osu.Framework.Input;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using OpenTK.Input;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play
|
|
|
|
|
{
|
2017-03-28 17:09:26 +08:00
|
|
|
|
public class PauseOverlay : InGameOverlay
|
2017-03-28 15:49:58 +08:00
|
|
|
|
{
|
|
|
|
|
public Action OnResume;
|
|
|
|
|
|
2017-04-06 03:36:03 +08: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 15:49:58 +08:00
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-28 16:33:56 +08:00
|
|
|
|
protected override void AddButtons(OsuColour colours)
|
2017-03-28 15:49:58 +08:00
|
|
|
|
{
|
2017-03-28 16:33:56 +08:00
|
|
|
|
AddButton(@"Continue", colours.Green, OnResume);
|
|
|
|
|
AddButton(@"Retry", colours.YellowDark, OnRetry);
|
|
|
|
|
AddButton(@"Quit to Main Menu", new Color4(170, 27, 39, 255), OnQuit);
|
2017-03-28 15:49:58 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|