1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 01:10:05 +08:00

Attempt to stay on correct difficulty

This commit is contained in:
Dean Herbert
2024-07-09 21:53:57 +09:00
Unverified
parent 27ab54882b
commit 3beca64cc5
+10 -2
View File
@@ -169,6 +169,8 @@ namespace osu.Game.Screens.Edit
private void finish()
{
string originalDifficulty = editor.Beatmap.Value.Beatmap.BeatmapInfo.DifficultyName;
showSpinner("Cleaning up...");
EditOperation!.Finish().ContinueWith(t =>
@@ -178,12 +180,18 @@ namespace osu.Game.Screens.Edit
// Setting to null will allow exit to succeed.
operation = null;
var beatmap = t.GetResultSafely();
Live<BeatmapSetInfo>? beatmap = t.GetResultSafely();
if (beatmap == null)
this.Exit();
else
editor.SwitchToDifficulty(beatmap.Value.Detach().Beatmaps.First());
{
var closestMatchingBeatmap =
beatmap.Value.Beatmaps.FirstOrDefault(b => b.DifficultyName == originalDifficulty)
?? beatmap.Value.Beatmaps.First();
editor.SwitchToDifficulty(closestMatchingBeatmap);
}
});
});
}