mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:02:54 +08:00
Set locally modified state for all externally modified beatmap(sets) that could not be mapped to online
This commit is contained in:
parent
a859978efd
commit
ac467cf73a
@ -204,6 +204,16 @@ namespace osu.Game.Screens.Edit
|
||||
this.Exit();
|
||||
else
|
||||
{
|
||||
// the `ImportAsUpdate()` flow will yield beatmap(sets) with online status of `None` if online lookup fails.
|
||||
// coerce such models to `LocallyModified` state instead to unify behaviour with normal editing flow.
|
||||
beatmap.PerformWrite(s =>
|
||||
{
|
||||
if (s.Status == BeatmapOnlineStatus.None)
|
||||
s.Status = BeatmapOnlineStatus.LocallyModified;
|
||||
foreach (var difficulty in s.Beatmaps.Where(b => b.Status == BeatmapOnlineStatus.None))
|
||||
difficulty.Status = BeatmapOnlineStatus.LocallyModified;
|
||||
});
|
||||
|
||||
var closestMatchingBeatmap =
|
||||
beatmap.Value.Beatmaps.FirstOrDefault(b => b.DifficultyName == originalDifficulty)
|
||||
?? beatmap.Value.Beatmaps.First();
|
||||
|
Loading…
Reference in New Issue
Block a user