mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
Some more clean up
This commit is contained in:
parent
d250dde537
commit
6c6ef946bd
@ -15,18 +15,6 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public override string Header => "failed";
|
||||
public override string Description => "you're dead, try again?";
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
{
|
||||
if (args.Repeat) return false;
|
||||
if (args.Key == Key.Escape)
|
||||
{
|
||||
if (State == Visibility.Hidden) return false;
|
||||
OnQuit();
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnKeyDown(state, args);
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
|
@ -23,7 +23,6 @@ namespace osu.Game.Screens.Play
|
||||
if (args.Repeat) return false;
|
||||
if (args.Key == Key.Escape)
|
||||
{
|
||||
if (State == Visibility.Hidden) return false;
|
||||
OnResume();
|
||||
return true;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public BeatmapInfo BeatmapInfo;
|
||||
|
||||
public bool IsPaused { get; private set; }
|
||||
public bool IsPaused => !sourceClock.IsRunning;
|
||||
|
||||
public bool HasFailed { get; private set; }
|
||||
|
||||
@ -204,19 +204,13 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
public void Pause(bool force = false)
|
||||
{
|
||||
if (canPause || force)
|
||||
{
|
||||
lastPauseActionTime = Time.Current;
|
||||
hudOverlay.KeyCounter.IsCounting = false;
|
||||
pauseOverlay.Retries = RestartCount;
|
||||
pauseOverlay.Show();
|
||||
sourceClock.Stop();
|
||||
IsPaused = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsPaused = false;
|
||||
}
|
||||
if (!canPause && !force) return;
|
||||
|
||||
lastPauseActionTime = Time.Current;
|
||||
hudOverlay.KeyCounter.IsCounting = false;
|
||||
pauseOverlay.Retries = RestartCount;
|
||||
pauseOverlay.Show();
|
||||
sourceClock.Stop();
|
||||
}
|
||||
|
||||
public void Resume()
|
||||
@ -225,13 +219,6 @@ namespace osu.Game.Screens.Play
|
||||
hudOverlay.KeyCounter.IsCounting = true;
|
||||
pauseOverlay.Hide();
|
||||
sourceClock.Start();
|
||||
IsPaused = false;
|
||||
}
|
||||
|
||||
public void TogglePaused()
|
||||
{
|
||||
IsPaused = !IsPaused;
|
||||
if (IsPaused) Pause(); else Resume();
|
||||
}
|
||||
|
||||
public void Restart()
|
||||
@ -273,11 +260,6 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private void onFail()
|
||||
{
|
||||
if (IsPaused)
|
||||
{
|
||||
pauseOverlay.Hide();
|
||||
IsPaused = false;
|
||||
}
|
||||
sourceClock.Stop();
|
||||
|
||||
Delay(500);
|
||||
@ -331,7 +313,7 @@ namespace osu.Game.Screens.Play
|
||||
//pause screen override logic.
|
||||
if (pauseOverlay?.State == Visibility.Hidden && !canPause) return true;
|
||||
|
||||
if (!IsPaused && sourceClock.IsRunning) // For if the user presses escape quickly when entering the map
|
||||
if (!IsPaused) // For if the user presses escape quickly when entering the map
|
||||
{
|
||||
Pause();
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user