mirror of
https://github.com/ppy/osu
synced 2025-01-20 04:50:50 +00: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)
|
public void BeginPlacement(HitObject hitObject)
|
||||||
{
|
{
|
||||||
|
EditorBeatmap.PlacementObject.Value = hitObject;
|
||||||
|
|
||||||
if (distanceSnapGrid != null)
|
if (distanceSnapGrid != null)
|
||||||
hitObject.StartTime = GetSnappedPosition(distanceSnapGrid.ToLocalSpace(inputManager.CurrentState.Mouse.Position), hitObject.StartTime).time;
|
hitObject.StartTime = GetSnappedPosition(distanceSnapGrid.ToLocalSpace(inputManager.CurrentState.Mouse.Position), hitObject.StartTime).time;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void EndPlacement(HitObject hitObject, bool commit)
|
public void EndPlacement(HitObject hitObject, bool commit)
|
||||||
{
|
{
|
||||||
|
EditorBeatmap.PlacementObject.Value = null;
|
||||||
|
|
||||||
if (commit)
|
if (commit)
|
||||||
{
|
{
|
||||||
EditorBeatmap.Add(hitObject);
|
EditorBeatmap.Add(hitObject);
|
||||||
|
@ -33,7 +33,15 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<HitObject> StartTimeChanged;
|
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;
|
public readonly IBeatmap PlayableBeatmap;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user