mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 06:23:21 +08:00
Merge branch 'master' into undelete-button-add
This commit is contained in:
commit
a9039c71e0
@ -124,44 +124,21 @@ namespace osu.Game.Screens.Play
|
||||
},
|
||||
};
|
||||
|
||||
Retries = 0;
|
||||
updateRetryCount();
|
||||
}
|
||||
|
||||
private int retries;
|
||||
|
||||
public int Retries
|
||||
{
|
||||
set
|
||||
{
|
||||
if (retryCounterContainer != null)
|
||||
{
|
||||
// "You've retried 1,065 times in this session"
|
||||
// "You've retried 1 time in this session"
|
||||
if (value == retries)
|
||||
return;
|
||||
|
||||
retryCounterContainer.Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = "You've retried ",
|
||||
Shadow = true,
|
||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||
TextSize = 18
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = $"{value:n0}",
|
||||
Font = @"Exo2.0-Bold",
|
||||
Shadow = true,
|
||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||
TextSize = 18
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = $" time{(value == 1 ? "" : "s")} in this session",
|
||||
Shadow = true,
|
||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||
TextSize = 18
|
||||
}
|
||||
};
|
||||
}
|
||||
retries = value;
|
||||
if (retryCounterContainer != null)
|
||||
updateRetryCount();
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,6 +229,38 @@ namespace osu.Game.Screens.Play
|
||||
selectionIndex = InternalButtons.IndexOf(button);
|
||||
}
|
||||
|
||||
private void updateRetryCount()
|
||||
{
|
||||
// "You've retried 1,065 times in this session"
|
||||
// "You've retried 1 time in this session"
|
||||
|
||||
retryCounterContainer.Children = new Drawable[]
|
||||
{
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = "You've retried ",
|
||||
Shadow = true,
|
||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||
TextSize = 18
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = $"{retries:n0}",
|
||||
Font = @"Exo2.0-Bold",
|
||||
Shadow = true,
|
||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||
TextSize = 18
|
||||
},
|
||||
new OsuSpriteText
|
||||
{
|
||||
Text = $" time{(retries == 1 ? "" : "s")} in this session",
|
||||
Shadow = true,
|
||||
ShadowColour = new Color4(0, 0, 0, 0.25f),
|
||||
TextSize = 18
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private class Button : DialogButton
|
||||
{
|
||||
protected override bool OnKeyDown(InputState state, KeyDownEventArgs args)
|
||||
|
@ -161,8 +161,8 @@ namespace osu.Game.Screens.Play
|
||||
OnRetry = Restart,
|
||||
OnQuit = Exit,
|
||||
CheckCanPause = () => AllowPause && ValidForResume && !HasFailed && !RulesetContainer.HasReplayLoaded,
|
||||
Retries = RestartCount,
|
||||
OnPause = () => {
|
||||
pauseContainer.Retries = RestartCount;
|
||||
hudOverlay.KeyCounter.IsCounting = pauseContainer.IsPaused;
|
||||
},
|
||||
OnResume = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user