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;
|
2018-03-14 14:18:21 +08:00
|
|
|
|
using osu.Game.Rulesets.Edit;
|
2018-03-12 16:18:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2018-02-20 17:01:45 +08:00
|
|
|
|
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
|
|
|
|
|
{
|
2018-03-14 14:18:21 +08:00
|
|
|
|
public class SliderCircleMask : HitObjectMask
|
2018-02-20 17:01:45 +08:00
|
|
|
|
{
|
2018-03-14 14:18:21 +08:00
|
|
|
|
public SliderCircleMask(DrawableHitCircle sliderHead, DrawableSlider slider)
|
2018-03-12 16:18:50 +08:00
|
|
|
|
: this(sliderHead, Vector2.Zero, slider)
|
2018-02-20 17:01:45 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-14 14:18:21 +08:00
|
|
|
|
public SliderCircleMask(DrawableSliderTail sliderTail, DrawableSlider slider)
|
2018-03-12 16:18:50 +08:00
|
|
|
|
: this(sliderTail, ((Slider)slider.HitObject).Curve.PositionAt(1), slider)
|
2018-02-20 17:01:45 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-01 13:34:31 +08:00
|
|
|
|
private readonly DrawableOsuHitObject hitObject;
|
|
|
|
|
|
2018-03-14 14:18:21 +08:00
|
|
|
|
private SliderCircleMask(DrawableOsuHitObject hitObject, Vector2 position, DrawableSlider slider)
|
2018-02-20 17:01:45 +08:00
|
|
|
|
: 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());
|
2018-03-29 21:41:49 +08:00
|
|
|
|
|
2018-04-04 19:44:07 +08:00
|
|
|
|
Select();
|
2018-02-20 17:01:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[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-03-29 21:41:49 +08:00
|
|
|
|
|
|
|
|
|
// Todo: This is temporary, since the slider circle masks don't do anything special yet. In the future they will handle input.
|
2018-03-30 13:14:04 +08:00
|
|
|
|
public override bool HandleMouseInput => false;
|
2018-02-20 17:01:45 +08:00
|
|
|
|
}
|
|
|
|
|
}
|