mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 10:02:54 +08:00
Fix "quick retry" hotkey not working for autoplay
This commit is contained in:
parent
2930db5d6e
commit
0e0d96829f
@ -34,10 +34,12 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
protected override UserActivity InitialActivity => new UserActivity.WatchingReplay(Score.ScoreInfo);
|
||||
|
||||
private bool isAutoplayPlayback => GameplayState.Mods.OfType<ModAutoplay>().Any();
|
||||
|
||||
// Disallow replays from failing. (see https://github.com/ppy/osu/issues/6108)
|
||||
protected override bool CheckModsAllowFailure()
|
||||
{
|
||||
if (!replayIsFailedScore && !GameplayState.Mods.OfType<ModAutoplay>().Any())
|
||||
if (!replayIsFailedScore && !isAutoplayPlayback)
|
||||
return false;
|
||||
|
||||
return base.CheckModsAllowFailure();
|
||||
@ -102,7 +104,12 @@ namespace osu.Game.Screens.Play
|
||||
Scores = { BindTarget = LeaderboardScores }
|
||||
};
|
||||
|
||||
protected override ResultsScreen CreateResults(ScoreInfo score) => new SoloResultsScreen(score);
|
||||
protected override ResultsScreen CreateResults(ScoreInfo score) => new SoloResultsScreen(score)
|
||||
{
|
||||
// Only show the relevant button otherwise things look silly.
|
||||
AllowWatchingReplay = !isAutoplayPlayback,
|
||||
AllowRetry = isAutoplayPlayback,
|
||||
};
|
||||
|
||||
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
{
|
||||
|
@ -38,8 +38,6 @@ namespace osu.Game.Screens.Ranking
|
||||
Icon = FontAwesome.Solid.Redo,
|
||||
},
|
||||
};
|
||||
|
||||
TooltipText = "retry";
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -48,7 +46,14 @@ namespace osu.Game.Screens.Ranking
|
||||
background.Colour = colours.Green;
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
TooltipText = player is ReplayPlayer ? "replay" : "retry";
|
||||
Action = () => player.Restart();
|
||||
}
|
||||
else
|
||||
{
|
||||
TooltipText = "retry";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user