From e08437c5dc34ec3bec18e81d5556e83c1fb56727 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Feb 2020 18:03:14 +0900 Subject: [PATCH] Track placement object in EditorBeatmap --- osu.Game/Rulesets/Edit/HitObjectComposer.cs | 4 ++++ osu.Game/Screens/Edit/EditorBeatmap.cs | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Edit/HitObjectComposer.cs b/osu.Game/Rulesets/Edit/HitObjectComposer.cs index e3f2fa915a..d946b2eb7f 100644 --- a/osu.Game/Rulesets/Edit/HitObjectComposer.cs +++ b/osu.Game/Rulesets/Edit/HitObjectComposer.cs @@ -250,12 +250,16 @@ namespace osu.Game.Rulesets.Edit public void BeginPlacement(HitObject hitObject) { + EditorBeatmap.PlacementObject.Value = hitObject; + if (distanceSnapGrid != null) hitObject.StartTime = GetSnappedPosition(distanceSnapGrid.ToLocalSpace(inputManager.CurrentState.Mouse.Position), hitObject.StartTime).time; } public void EndPlacement(HitObject hitObject, bool commit) { + EditorBeatmap.PlacementObject.Value = null; + if (commit) { EditorBeatmap.Add(hitObject); diff --git a/osu.Game/Screens/Edit/EditorBeatmap.cs b/osu.Game/Screens/Edit/EditorBeatmap.cs index cacb539891..e1f3ddf191 100644 --- a/osu.Game/Screens/Edit/EditorBeatmap.cs +++ b/osu.Game/Screens/Edit/EditorBeatmap.cs @@ -33,7 +33,15 @@ namespace osu.Game.Screens.Edit /// public event Action StartTimeChanged; - public BindableList SelectedHitObjects { get; } = new BindableList(); + /// + /// All currently selected s. + /// + public readonly BindableList SelectedHitObjects = new BindableList(); + + /// + /// The current placement + /// + public readonly Bindable PlacementObject = new Bindable(); public readonly IBeatmap PlayableBeatmap;