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-10-03 15:27:26 +08:00
|
|
|
|
|
|
|
using osu.Framework.Input.Events;
|
|
|
|
using osu.Game.Rulesets.Edit;
|
2018-11-07 15:08:56 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
|
2018-10-26 14:26:08 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2019-01-26 22:55:33 +08:00
|
|
|
using osuTK;
|
2018-10-03 15:27:26 +08:00
|
|
|
|
2018-11-07 15:08:56 +08:00
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles
|
2018-10-03 15:27:26 +08:00
|
|
|
{
|
2018-11-06 17:04:03 +08:00
|
|
|
public class HitCirclePlacementBlueprint : PlacementBlueprint
|
2018-10-03 15:27:26 +08:00
|
|
|
{
|
2018-10-26 14:26:08 +08:00
|
|
|
public new HitCircle HitObject => (HitCircle)base.HitObject;
|
2018-10-03 15:27:26 +08:00
|
|
|
|
2019-09-27 17:45:22 +08:00
|
|
|
private readonly HitCirclePiece circlePiece;
|
|
|
|
|
2018-11-06 17:04:03 +08:00
|
|
|
public HitCirclePlacementBlueprint()
|
2018-10-26 14:26:08 +08:00
|
|
|
: base(new HitCircle())
|
2018-10-03 15:27:26 +08:00
|
|
|
{
|
2019-09-27 17:45:22 +08:00
|
|
|
InternalChild = circlePiece = new HitCirclePiece();
|
2018-10-03 15:27:26 +08:00
|
|
|
}
|
|
|
|
|
2019-10-07 17:49:59 +08:00
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
circlePiece.UpdateFrom(HitObject);
|
|
|
|
}
|
|
|
|
|
2018-10-03 15:27:26 +08:00
|
|
|
protected override bool OnClick(ClickEvent e)
|
|
|
|
{
|
2018-10-17 13:37:39 +08:00
|
|
|
EndPlacement();
|
2018-10-03 15:27:26 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-10-03 15:14:42 +08:00
|
|
|
public override void UpdatePosition(Vector2 screenSpacePosition)
|
2018-10-03 15:27:26 +08:00
|
|
|
{
|
2019-10-03 15:14:42 +08:00
|
|
|
HitObject.Position = ToLocalSpace(screenSpacePosition);
|
2018-10-03 15:27:26 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|