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:
parent
e31d69c749
commit
e08437c5dc
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user