2019-01-24 16:43:03 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-11-12 17:24:18 +08:00
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Rulesets.Mania.Edit.Blueprints.Components;
|
|
|
|
using osu.Game.Rulesets.Mania.Objects;
|
2020-04-23 11:05:34 +08:00
|
|
|
using osuTK;
|
2018-11-12 17:24:18 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
|
|
|
{
|
2018-11-12 17:32:44 +08:00
|
|
|
public class NotePlacementBlueprint : ManiaPlacementBlueprint<Note>
|
2018-11-12 17:24:18 +08:00
|
|
|
{
|
|
|
|
public NotePlacementBlueprint()
|
|
|
|
: base(new Note())
|
|
|
|
{
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
|
|
|
InternalChild = new EditNotePiece { RelativeSizeAxes = Axes.X };
|
|
|
|
}
|
|
|
|
|
2018-11-13 13:13:29 +08:00
|
|
|
protected override void Update()
|
2018-11-12 17:24:18 +08:00
|
|
|
{
|
2018-11-13 13:13:29 +08:00
|
|
|
base.Update();
|
|
|
|
|
2018-11-19 17:40:16 +08:00
|
|
|
Width = SnappedWidth;
|
2018-11-13 13:13:29 +08:00
|
|
|
Position = SnappedMousePosition;
|
2018-11-12 17:24:18 +08:00
|
|
|
}
|
2020-04-23 11:05:34 +08:00
|
|
|
|
|
|
|
public override void UpdatePosition(Vector2 screenSpacePosition)
|
|
|
|
{
|
|
|
|
base.UpdatePosition(screenSpacePosition);
|
|
|
|
|
|
|
|
// Continue updating the position until placement is finished on mouse up.
|
2020-04-23 11:53:09 +08:00
|
|
|
BeginPlacement(TimeAt(screenSpacePosition), PlacementActive);
|
2020-04-23 11:05:34 +08:00
|
|
|
}
|
2018-11-12 17:24:18 +08:00
|
|
|
}
|
|
|
|
}
|