1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 18:12:56 +08:00

Allow transfer of previously loaded background between WorkingBeatmaps

This commit is contained in:
Dean Herbert 2017-04-28 15:03:07 +09:00
parent 88b2b740d7
commit 28375ed1fc
2 changed files with 7 additions and 0 deletions

View File

@ -94,6 +94,9 @@ namespace osu.Game.Beatmaps
{ {
if (track != null && BeatmapInfo.AudioEquals(other.BeatmapInfo)) if (track != null && BeatmapInfo.AudioEquals(other.BeatmapInfo))
other.track = track; other.track = track;
if (background != null && BeatmapInfo.BackgroundEquals(other.BeatmapInfo))
other.background = background;
} }
public virtual void Dispose() public virtual void Dispose()

View File

@ -93,5 +93,9 @@ namespace osu.Game.Database
public bool AudioEquals(BeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null && public bool AudioEquals(BeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
BeatmapSet.Path == other.BeatmapSet.Path && BeatmapSet.Path == other.BeatmapSet.Path &&
(Metadata ?? BeatmapSet.Metadata).AudioFile == (other.Metadata ?? other.BeatmapSet.Metadata).AudioFile; (Metadata ?? BeatmapSet.Metadata).AudioFile == (other.Metadata ?? other.BeatmapSet.Metadata).AudioFile;
public bool BackgroundEquals(BeatmapInfo other) => other != null && BeatmapSet != null && other.BeatmapSet != null &&
BeatmapSet.Path == other.BeatmapSet.Path &&
(Metadata ?? BeatmapSet.Metadata).BackgroundFile == (other.Metadata ?? other.BeatmapSet.Metadata).BackgroundFile;
} }
} }