1
0
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:
Dean Herbert 2024-12-13 18:08:29 +09:00
parent 2930db5d6e
commit 0e0d96829f
No known key found for this signature in database
2 changed files with 16 additions and 4 deletions

View File

@ -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)
{

View File

@ -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";
}
}
}
}