2019-01-24 16:43:03 +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;
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2020-11-04 15:19:07 +08:00
|
|
|
using osuTK;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Objects.Drawables
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Visualises a <see cref="BarLine"/>. Although this derives DrawableManiaHitObject,
|
|
|
|
/// this does not handle input/sound like a normal hit object.
|
|
|
|
/// </summary>
|
2019-09-25 05:03:55 +08:00
|
|
|
public class DrawableBarLine : DrawableManiaHitObject<BarLine>
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
|
|
|
public DrawableBarLine(BarLine barLine)
|
|
|
|
: base(barLine)
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2022-08-08 16:38:56 +08:00
|
|
|
Height = barLine.Major ? 1.7f : 1.2f;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
AddInternal(new Box
|
|
|
|
{
|
|
|
|
Name = "Bar line",
|
|
|
|
Anchor = Anchor.BottomCentre,
|
|
|
|
Origin = Anchor.BottomCentre,
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2022-08-08 16:38:56 +08:00
|
|
|
Alpha = barLine.Major ? 0.5f : 0.2f
|
2018-04-13 17:19:50 +08:00
|
|
|
});
|
|
|
|
|
2019-09-10 12:29:50 +08:00
|
|
|
if (barLine.Major)
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2022-08-08 16:38:56 +08:00
|
|
|
Vector2 size = new Vector2(22, 6);
|
2022-08-09 12:20:20 +08:00
|
|
|
const float line_offset = 4;
|
2022-08-08 16:38:56 +08:00
|
|
|
|
|
|
|
AddInternal(new Circle
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2022-08-08 16:38:56 +08:00
|
|
|
Name = "Left line",
|
|
|
|
Anchor = Anchor.CentreLeft,
|
|
|
|
Origin = Anchor.CentreRight,
|
|
|
|
|
|
|
|
Size = size,
|
2022-08-09 12:20:20 +08:00
|
|
|
X = -line_offset,
|
2018-04-13 17:19:50 +08:00
|
|
|
});
|
|
|
|
|
2022-08-08 16:38:56 +08:00
|
|
|
AddInternal(new Circle
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2022-08-08 16:38:56 +08:00
|
|
|
Name = "Right line",
|
|
|
|
Anchor = Anchor.CentreRight,
|
|
|
|
Origin = Anchor.CentreLeft,
|
|
|
|
Size = size,
|
2022-08-09 12:20:20 +08:00
|
|
|
X = line_offset,
|
2018-04-13 17:19:50 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-04 15:19:07 +08:00
|
|
|
protected override void UpdateStartTimeStateTransforms() => this.FadeOut(150);
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
}
|