1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 03:47:26 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/SliderCircleOverlay.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.4 KiB
C#
Raw Normal View History

2021-05-18 13:19:11 +08: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 17:19:50 +08:00
using osu.Framework.Graphics;
2021-05-18 13:19:11 +08:00
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
using osu.Game.Rulesets.Osu.Objects;
2018-04-13 17:19:50 +08:00
2018-11-07 15:08:56 +08:00
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
{
2021-05-18 13:19:11 +08:00
public partial class SliderCircleOverlay : CompositeDrawable
{
protected readonly HitCirclePiece CirclePiece;
2023-12-20 07:05:32 +08:00
protected readonly Slider Slider;
private readonly HitCircleOverlapMarker marker;
2023-12-20 07:05:32 +08:00
private readonly SliderPosition position;
2021-05-18 13:19:11 +08:00
public SliderCircleOverlay(Slider slider, SliderPosition position)
{
2023-12-20 07:05:32 +08:00
Slider = slider;
this.position = position;
2020-01-24 16:50:36 +08:00
InternalChildren = new Drawable[]
{
marker = new HitCircleOverlapMarker(),
CirclePiece = new HitCirclePiece(),
};
}
2018-04-13 17:19:50 +08:00
protected override void Update()
{
base.Update();
2023-12-20 07:05:32 +08: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();
}
}
}