mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
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:
@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user