1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Track placement object in EditorBeatmap

This commit is contained in:
Dean Herbert 2020-02-07 18:03:14 +09:00
parent e31d69c749
commit e08437c5dc
2 changed files with 13 additions and 1 deletions

View File

@ -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);

View File

@ -33,7 +33,15 @@ namespace osu.Game.Screens.Edit
/// </summary>
public event Action<HitObject> StartTimeChanged;
public BindableList<HitObject> SelectedHitObjects { get; } = new BindableList<HitObject>();
/// <summary>
/// All currently selected <see cref="HitObject"/>s.
/// </summary>
public readonly BindableList<HitObject> SelectedHitObjects = new BindableList<HitObject>();
/// <summary>
/// The current placement
/// </summary>
public readonly Bindable<HitObject> PlacementObject = new Bindable<HitObject>();
public readonly IBeatmap PlayableBeatmap;