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-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
2018-11-07 15:08:56 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-11-07 15:08:56 +08:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-09-27 17:45:22 +08:00
|
|
|
|
public class SliderSelectionBlueprint : OsuSelectionBlueprint<Slider>
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-09-27 17:45:22 +08:00
|
|
|
|
private readonly SliderBodyPiece bodyPiece;
|
2018-11-06 16:56:04 +08:00
|
|
|
|
private readonly SliderCircleSelectionBlueprint headBlueprint;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-11-06 16:56:04 +08:00
|
|
|
|
public SliderSelectionBlueprint(DrawableSlider slider)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
: base(slider)
|
|
|
|
|
{
|
|
|
|
|
var sliderObject = (Slider)slider.HitObject;
|
|
|
|
|
|
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
|
{
|
2019-09-27 17:45:22 +08:00
|
|
|
|
bodyPiece = new SliderBodyPiece(),
|
|
|
|
|
headBlueprint = new SliderCircleSelectionBlueprint(slider, SliderPosition.Start),
|
|
|
|
|
new SliderCircleSelectionBlueprint(slider, SliderPosition.End),
|
2018-11-01 02:52:24 +08:00
|
|
|
|
new PathControlPointVisualiser(sliderObject),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-27 17:45:22 +08:00
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
|
|
bodyPiece.UpdateFrom(HitObject);
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-06 16:56:04 +08:00
|
|
|
|
public override Vector2 SelectionPoint => headBlueprint.SelectionPoint;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|