2018-02-20 17:01:45 +08:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Rulesets.Edit.Layers.Selection;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
|
|
|
|
|
using OpenTK;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays
|
|
|
|
|
{
|
|
|
|
|
public class SliderCircleOverlay : HitObjectOverlay
|
|
|
|
|
{
|
|
|
|
|
public SliderCircleOverlay(DrawableHitCircle sliderHead, DrawableSlider slider)
|
2018-03-01 13:34:31 +08:00
|
|
|
|
: this(sliderHead, sliderHead.Position, slider)
|
2018-02-20 17:01:45 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SliderCircleOverlay(DrawableSliderTail sliderTail, DrawableSlider slider)
|
2018-03-01 13:34:31 +08:00
|
|
|
|
: this(sliderTail, sliderTail.Position, slider)
|
2018-02-20 17:01:45 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-01 13:34:31 +08:00
|
|
|
|
private readonly DrawableOsuHitObject hitObject;
|
|
|
|
|
|
2018-02-20 17:01:45 +08:00
|
|
|
|
private SliderCircleOverlay(DrawableOsuHitObject hitObject, Vector2 position, DrawableSlider slider)
|
|
|
|
|
: base(hitObject)
|
|
|
|
|
{
|
2018-03-01 13:34:31 +08:00
|
|
|
|
this.hitObject = hitObject;
|
|
|
|
|
|
2018-02-20 17:01:45 +08:00
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
|
|
Position = position;
|
|
|
|
|
Size = slider.HeadCircle.Size;
|
|
|
|
|
Scale = slider.HeadCircle.Scale;
|
|
|
|
|
|
|
|
|
|
AddInternal(new RingPiece());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
Colour = colours.Yellow;
|
|
|
|
|
}
|
2018-03-01 13:34:31 +08:00
|
|
|
|
|
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
|
|
RelativeAnchorPosition = hitObject.RelativeAnchorPosition;
|
|
|
|
|
}
|
2018-02-20 17:01:45 +08:00
|
|
|
|
}
|
|
|
|
|
}
|