2021-05-18 05:19:11 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-01-24 08:43:03 +00:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2022-05-12 10:26:34 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
2021-05-18 05:19:11 +00:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-09-27 09:45:22 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
|
2018-03-12 08:18:50 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
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-02-20 09:01:45 +00:00
|
|
|
|
{
|
2021-05-18 05:19:11 +00:00
|
|
|
|
public partial class SliderCircleOverlay : CompositeDrawable
|
2018-02-20 09:01:45 +00:00
|
|
|
|
{
|
2019-10-01 10:33:24 +00:00
|
|
|
|
protected readonly HitCirclePiece CirclePiece;
|
|
|
|
|
|
2021-05-18 05:19:11 +00:00
|
|
|
|
private readonly Slider slider;
|
2019-09-27 09:45:22 +00:00
|
|
|
|
private readonly SliderPosition position;
|
2022-05-12 10:26:34 +00:00
|
|
|
|
private readonly HitCircleOverlapMarker marker;
|
2019-09-27 09:45:22 +00:00
|
|
|
|
|
2021-05-18 05:19:11 +00:00
|
|
|
|
public SliderCircleOverlay(Slider slider, SliderPosition position)
|
2018-02-20 09:01:45 +00:00
|
|
|
|
{
|
2021-05-18 05:19:11 +00:00
|
|
|
|
this.slider = slider;
|
2019-09-27 09:45:22 +00:00
|
|
|
|
this.position = position;
|
2020-01-24 08:50:36 +00:00
|
|
|
|
|
2022-05-12 10:26:34 +00:00
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
marker = new HitCircleOverlapMarker(),
|
|
|
|
|
CirclePiece = new HitCirclePiece(),
|
|
|
|
|
};
|
2018-02-20 09:01:45 +00:00
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2019-09-27 09:45:22 +00:00
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
2022-05-12 10:26:34 +00:00
|
|
|
|
var circle = position == SliderPosition.Start ? (HitCircle)slider.HeadCircle : slider.TailCircle;
|
|
|
|
|
|
|
|
|
|
CirclePiece.UpdateFrom(circle);
|
|
|
|
|
marker.UpdateFrom(circle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Hide()
|
|
|
|
|
{
|
|
|
|
|
CirclePiece.Hide();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Show()
|
|
|
|
|
{
|
|
|
|
|
CirclePiece.Show();
|
2019-09-27 09:45:22 +00:00
|
|
|
|
}
|
2018-02-20 09:01:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|