mirror of
https://github.com/ppy/osu
synced 2024-12-17 04:15:37 +00:00
Merge pull request #18754 from peppy/placement-object-use-last-sample-point
Fix new hitobject placements not taking on the existing sample settings
This commit is contained in:
commit
24c78c24f0
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -73,6 +74,10 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
/// <param name="commitStart">Whether this call is committing a value for HitObject.StartTime and continuing with further adjustments.</param>
|
/// <param name="commitStart">Whether this call is committing a value for HitObject.StartTime and continuing with further adjustments.</param>
|
||||||
protected void BeginPlacement(bool commitStart = false)
|
protected void BeginPlacement(bool commitStart = false)
|
||||||
{
|
{
|
||||||
|
var nearestSampleControlPoint = beatmap.HitObjects.LastOrDefault(h => h.GetEndTime() < HitObject.StartTime)?.SampleControlPoint?.DeepClone() as SampleControlPoint;
|
||||||
|
|
||||||
|
HitObject.SampleControlPoint = nearestSampleControlPoint ?? new SampleControlPoint();
|
||||||
|
|
||||||
placementHandler.BeginPlacement(HitObject);
|
placementHandler.BeginPlacement(HitObject);
|
||||||
if (commitStart)
|
if (commitStart)
|
||||||
PlacementActive = PlacementState.Active;
|
PlacementActive = PlacementState.Active;
|
||||||
|
Loading…
Reference in New Issue
Block a user