1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 21:17:33 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Edit/Masks/SliderCircleSelectionMask.cs

62 lines
1.9 KiB
C#
Raw Normal View History

2018-04-13 17:19:50 +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;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables.Pieces;
using OpenTK;
2018-10-03 12:45:41 +08:00
namespace osu.Game.Rulesets.Osu.Edit.Masks
2018-04-13 17:19:50 +08:00
{
2018-10-03 12:28:00 +08:00
public class SliderCircleSelectionMask : SelectionMask
2018-04-13 17:19:50 +08:00
{
2018-10-03 12:28:00 +08:00
public SliderCircleSelectionMask(DrawableHitCircle sliderHead, DrawableSlider slider)
2018-04-13 17:19:50 +08:00
: this(sliderHead, Vector2.Zero, slider)
{
}
2018-10-03 12:28:00 +08:00
public SliderCircleSelectionMask(DrawableSliderTail sliderTail, DrawableSlider slider)
2018-04-13 17:19:50 +08:00
: this(sliderTail, ((Slider)slider.HitObject).Curve.PositionAt(1), slider)
{
}
private readonly DrawableOsuHitObject hitObject;
2018-10-03 12:28:00 +08:00
private SliderCircleSelectionMask(DrawableOsuHitObject hitObject, Vector2 position, DrawableSlider slider)
2018-04-13 17:19:50 +08:00
: base(hitObject)
{
this.hitObject = hitObject;
Origin = Anchor.Centre;
Position = position;
Size = slider.HeadCircle.Size;
Scale = slider.HeadCircle.Scale;
AddInternal(new RingPiece());
Select();
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.Yellow;
}
protected override void Update()
{
base.Update();
RelativeAnchorPosition = hitObject.RelativeAnchorPosition;
}
// Todo: This is temporary, since the slider circle masks don't do anything special yet. In the future they will handle input.
public override bool HandlePositionalInput => false;
2018-04-13 17:19:50 +08:00
}
}