diff --git a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs index 8d7eb41369..7440697ba0 100644 --- a/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs +++ b/osu.Game.Tests/Visual/Editing/TestSceneEditorBeatmapCreation.cs @@ -132,6 +132,7 @@ namespace osu.Game.Tests.Visual.Editing AddStep("set unique difficulty name", () => EditorBeatmap.BeatmapInfo.DifficultyName = firstDifficultyName); AddStep("add timing point", () => EditorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 1000 })); AddStep("add effect point", () => EditorBeatmap.ControlPointInfo.Add(500, new EffectControlPoint { KiaiMode = true })); + AddStep("add bookmarks", () => EditorBeatmap.Bookmarks.AddRange([500, 1000])); AddStep("add hitobjects", () => EditorBeatmap.AddRange(new[] { new HitCircle @@ -185,6 +186,7 @@ namespace osu.Game.Tests.Visual.Editing var effectPoint = EditorBeatmap.ControlPointInfo.EffectPoints.Single(); return effectPoint.Time == 500 && effectPoint.KiaiMode && effectPoint.ScrollSpeedBindable.IsDefault; }); + AddAssert("created difficulty has bookmarks", () => EditorBeatmap.Bookmarks.Count == 2); AddAssert("created difficulty has no objects", () => EditorBeatmap.HitObjects.Count == 0); AddAssert("status is modified", () => EditorBeatmap.BeatmapInfo.Status == BeatmapOnlineStatus.LocallyModified); @@ -223,6 +225,7 @@ namespace osu.Game.Tests.Visual.Editing AddStep("set unique difficulty name", () => EditorBeatmap.BeatmapInfo.DifficultyName = previousDifficultyName = Guid.NewGuid().ToString()); AddStep("add timing point", () => EditorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 1000 })); + AddStep("add bookmarks", () => EditorBeatmap.Bookmarks.AddRange([500, 1000])); AddStep("add effect points", () => { EditorBeatmap.ControlPointInfo.Add(250, new EffectControlPoint { KiaiMode = false, ScrollSpeed = 0.05 }); @@ -253,6 +256,8 @@ namespace osu.Game.Tests.Visual.Editing return timingPoint.Time == 0 && timingPoint.BeatLength == 1000; }); + AddAssert("created difficulty has bookmarks", () => EditorBeatmap.Bookmarks.Count == 2); + AddAssert("created difficulty has effect points", () => { return EditorBeatmap.ControlPointInfo.EffectPoints.SequenceEqual(new[] @@ -284,6 +289,7 @@ namespace osu.Game.Tests.Visual.Editing AddStep("set unique difficulty name", () => EditorBeatmap.BeatmapInfo.DifficultyName = firstDifficultyName); AddStep("add timing point", () => EditorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 1000 })); + AddStep("add bookmarks", () => EditorBeatmap.Bookmarks.AddRange([500, 1000])); AddStep("add effect points", () => { EditorBeatmap.ControlPointInfo.Add(250, new EffectControlPoint { KiaiMode = false, ScrollSpeed = 0.05 }); @@ -311,6 +317,8 @@ namespace osu.Game.Tests.Visual.Editing return timingPoint.Time == 0 && timingPoint.BeatLength == 1000; }); + AddAssert("created difficulty has bookmarks", () => EditorBeatmap.Bookmarks.Count == 2); + AddAssert("created difficulty has effect points", () => { // since this difficulty is on another ruleset, scroll speed specifications are completely reset, @@ -344,6 +352,7 @@ namespace osu.Game.Tests.Visual.Editing StartTime = 1000 } })); + AddStep("add bookmarks", () => EditorBeatmap.Bookmarks.AddRange([500, 1000])); AddStep("set approach rate", () => EditorBeatmap.Difficulty.ApproachRate = 4); AddStep("set combo colours", () => { @@ -394,6 +403,7 @@ namespace osu.Game.Tests.Visual.Editing return timingPoint.Time == 0 && timingPoint.BeatLength == 1000; }); AddAssert("created difficulty has objects", () => EditorBeatmap.HitObjects.Count == 2); + AddAssert("created difficulty has bookmarks", () => EditorBeatmap.Bookmarks.Count == 2); AddAssert("approach rate correctly copied", () => EditorBeatmap.Difficulty.ApproachRate == 4); AddAssert("combo colours correctly copied", () => EditorBeatmap.BeatmapSkin.AsNonNull().ComboColours.Count == 2); diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 8446f43c53..6d1dbaafba 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -154,7 +154,11 @@ namespace osu.Game.Beatmaps { DifficultyName = NamingUtils.GetNextBestName(targetBeatmapSet.Beatmaps.Select(b => b.DifficultyName), "New Difficulty") }; - var newBeatmap = new Beatmap { BeatmapInfo = newBeatmapInfo }; + var newBeatmap = new Beatmap + { + BeatmapInfo = newBeatmapInfo, + Bookmarks = referenceWorkingBeatmap.Beatmap.Bookmarks.ToArray() + }; foreach (var timingPoint in referenceWorkingBeatmap.Beatmap.ControlPointInfo.TimingPoints) newBeatmap.ControlPointInfo.Add(timingPoint.Time, timingPoint.DeepClone());