Set actions for retry/quit, moved setting paused to PopIn and PopOut, added null propogation for the sound samples for PauseButton(sometimes in the visual tests the audio doesn't load for whatever reason), added a gradient to the background of the PauseOverlay visual test(same as the one in the menu button system test), wired up the retry and quit actions in Player, made the quit action quit the map, retry still does nothing

This commit is contained in:
DrabWeb
2017-01-27 06:19:52 -04:00
parent dedd6a4bcf
commit f35974021a
4 changed files with 37 additions and 18 deletions

View File

@ -2,14 +2,12 @@
using OpenTK;
using OpenTK.Input;
using OpenTK.Graphics;
using osu.Game.Screens;
using osu.Game.Graphics;
using osu.Framework.Input;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Graphics.Transformations;
@ -47,26 +45,30 @@ namespace osu.Game.Overlays.Pause
{
Text = @"Retry",
Origin = Anchor.Centre,
Anchor = Anchor.Centre
Anchor = Anchor.Centre,
Action = Retry
},
new PauseButton
{
Text = @"Quit",
Origin = Anchor.Centre,
Anchor = Anchor.Centre,
Position = new Vector2(0, 200)
Position = new Vector2(0, 200),
Action = Quit
}
};
}
protected override void PopIn()
{
this.FadeTo(1, 100, EasingTypes.In);
this.FadeTo(1, 100, EasingTypes.In);
paused = true;
}
protected override void PopOut()
{
this.FadeTo(0, 100, EasingTypes.In);
this.FadeTo(0, 100, EasingTypes.In);
paused = false;
}
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
@ -83,25 +85,25 @@ namespace osu.Game.Overlays.Pause
private void Pause()
{
paused = true;
Show();
OnPause?.Invoke();
}
private void Play()
{
paused = false;
Hide();
OnPlay?.Invoke();
}
private void Retry()
{
{
Hide();
OnRetry?.Invoke();
}
private void Quit()
{
{
Hide();
OnQuit?.Invoke();
}