mirror of
https://github.com/ppy/osu
synced 2024-12-25 00:02:48 +00:00
Added PauseOverlay.SetRetries for updating the retry indicator
This commit is contained in:
parent
d4216eb539
commit
d0a22bfdd4
@ -68,7 +68,6 @@ namespace osu.Game.Overlays.Pause
|
||||
},
|
||||
retryCounter = new SpriteText
|
||||
{
|
||||
Text = @"You've retried 0 times in this session",
|
||||
Origin = Anchor.TopCentre,
|
||||
Anchor = Anchor.Centre,
|
||||
Width = 100,
|
||||
@ -108,7 +107,7 @@ namespace osu.Game.Overlays.Pause
|
||||
Action = (delegate
|
||||
{
|
||||
Hide();
|
||||
Task.Delay(fadeDuration * 2).ContinueWith(t=> OnResume?.Invoke());
|
||||
Task.Delay(fadeDuration * 2).ContinueWith(task => OnResume?.Invoke());
|
||||
}),
|
||||
},
|
||||
new PauseButton
|
||||
@ -135,7 +134,17 @@ namespace osu.Game.Overlays.Pause
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
SetRetries(0);
|
||||
}
|
||||
|
||||
public void SetRetries(int count)
|
||||
{
|
||||
if (retryCounter != null)
|
||||
// "You've retried 1,065 times in this session"
|
||||
// "You've retried 1 time in this session"
|
||||
retryCounter.Text = $"You've retried {String.Format("{0:n0}", count)} time{(count == 1) ? "" : "s"} in this session";
|
||||
}
|
||||
|
||||
protected override void PopIn()
|
||||
@ -155,7 +164,7 @@ namespace osu.Game.Overlays.Pause
|
||||
case Key.Escape:
|
||||
if (State == Visibility.Hidden) return false;
|
||||
Hide();
|
||||
Task.Delay(fadeDuration * 2).ContinueWith(t => OnResume?.Invoke());
|
||||
Task.Delay(fadeDuration * 2).ContinueWith(task => OnResume?.Invoke());
|
||||
return true;
|
||||
}
|
||||
return base.OnKeyDown(state, args);
|
||||
|
Loading…
Reference in New Issue
Block a user