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