mirror of https://github.com/ppy/osu
Merge pull request #19964 from nanashi-1/merge-hitobject-hitsound-fix
Fix hitobjects merge feature in editor not adding any hitsounds
This commit is contained in:
commit
69cbc0125b
|
@ -77,6 +77,8 @@ public void TestMergeCircleSlider()
|
|||
return sliderCreatedFor(args);
|
||||
});
|
||||
|
||||
AddAssert("samples exist", sliderSampleExist);
|
||||
|
||||
AddStep("undo", () => Editor.Undo());
|
||||
AddAssert("merged objects restored", () => circle1 is not null && circle2 is not null && slider is not null && objectsRestored(circle1, slider, circle2));
|
||||
}
|
||||
|
@ -122,6 +124,8 @@ public void TestMergeSliderSlider()
|
|||
return sliderCreatedFor(args);
|
||||
});
|
||||
|
||||
AddAssert("samples exist", sliderSampleExist);
|
||||
|
||||
AddAssert("merged slider matches first slider", () =>
|
||||
{
|
||||
var mergedSlider = (Slider)EditorBeatmap.SelectedHitObjects.First();
|
||||
|
@ -165,6 +169,8 @@ public void TestNonMerge()
|
|||
(pos: circle1.Position, pathType: PathType.Linear),
|
||||
(pos: circle2.Position, pathType: null)));
|
||||
|
||||
AddAssert("samples exist", sliderSampleExist);
|
||||
|
||||
AddAssert("spinner not merged", () => EditorBeatmap.HitObjects.Contains(spinner));
|
||||
}
|
||||
|
||||
|
@ -209,5 +215,15 @@ private bool objectsRestored(params HitObject[] objects)
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool sliderSampleExist()
|
||||
{
|
||||
if (EditorBeatmap.SelectedHitObjects.Count != 1)
|
||||
return false;
|
||||
|
||||
var mergedSlider = (Slider)EditorBeatmap.SelectedHitObjects.First();
|
||||
|
||||
return mergedSlider.Samples[0] is not null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -371,6 +371,7 @@ private void mergeSelection()
|
|||
Position = firstHitObject.Position,
|
||||
NewCombo = firstHitObject.NewCombo,
|
||||
SampleControlPoint = firstHitObject.SampleControlPoint,
|
||||
Samples = firstHitObject.Samples,
|
||||
};
|
||||
|
||||
if (mergedHitObject.Path.ControlPoints.Count == 0)
|
||||
|
|
Loading…
Reference in New Issue