2019-01-24 08:43:03 +00: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-05-20 10:22:42 +00:00
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2018-05-20 10:22:42 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
2020-03-31 07:42:35 +00:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2018-11-06 07:19:40 +00:00
|
|
|
|
using osu.Framework.Graphics.Primitives;
|
2020-03-31 07:42:35 +00:00
|
|
|
|
using osu.Framework.Graphics.Shapes;
|
2018-05-20 10:22:42 +00:00
|
|
|
|
using osu.Game.Graphics;
|
2021-06-15 04:20:33 +00:00
|
|
|
|
using osu.Game.Rulesets.Mania.Edit.Blueprints.Components;
|
2021-05-13 10:53:32 +00:00
|
|
|
|
using osu.Game.Rulesets.Mania.Objects;
|
2018-11-20 07:51:59 +00:00
|
|
|
|
using osuTK;
|
2018-05-20 10:22:42 +00:00
|
|
|
|
|
2018-11-07 07:08:56 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
2018-05-20 10:22:42 +00:00
|
|
|
|
{
|
2021-05-13 10:53:32 +00:00
|
|
|
|
public partial class HoldNoteSelectionBlueprint : ManiaSelectionBlueprint<HoldNote>
|
2018-05-20 10:22:42 +00:00
|
|
|
|
{
|
2019-10-17 07:14:28 +00:00
|
|
|
|
[Resolved]
|
|
|
|
|
private OsuColour colours { get; set; }
|
2018-05-20 10:22:42 +00:00
|
|
|
|
|
2021-06-15 04:20:33 +00:00
|
|
|
|
private EditNotePiece head;
|
|
|
|
|
private EditNotePiece tail;
|
|
|
|
|
|
2021-05-13 10:53:32 +00:00
|
|
|
|
public HoldNoteSelectionBlueprint(HoldNote hold)
|
2018-05-20 10:22:42 +00:00
|
|
|
|
: base(hold)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2022-01-15 00:06:39 +00:00
|
|
|
|
private void load()
|
2018-05-20 10:22:42 +00:00
|
|
|
|
{
|
2019-10-17 07:14:28 +00:00
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
|
{
|
2021-06-15 04:20:33 +00:00
|
|
|
|
head = new EditNotePiece { RelativeSizeAxes = Axes.X },
|
|
|
|
|
tail = new EditNotePiece { RelativeSizeAxes = Axes.X },
|
2020-03-31 07:42:35 +00:00
|
|
|
|
new Container
|
2019-10-17 07:14:28 +00:00
|
|
|
|
{
|
2020-03-31 07:42:35 +00:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2020-04-11 06:20:27 +00:00
|
|
|
|
Masking = true,
|
2020-03-31 07:42:35 +00:00
|
|
|
|
BorderThickness = 1,
|
|
|
|
|
BorderColour = colours.Yellow,
|
|
|
|
|
Child = new Box
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
AlwaysPresent = true,
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-10-17 07:14:28 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-07 10:00:02 +00:00
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
2021-06-15 04:20:33 +00:00
|
|
|
|
head.Y = HitObjectContainer.PositionAtTime(HitObject.Head.StartTime, HitObject.StartTime);
|
|
|
|
|
tail.Y = HitObjectContainer.PositionAtTime(HitObject.Tail.StartTime, HitObject.StartTime);
|
|
|
|
|
Height = HitObjectContainer.LengthAtTime(HitObject.StartTime, HitObject.EndTime) + tail.DrawHeight;
|
2018-06-07 10:00:02 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-11-06 07:19:40 +00:00
|
|
|
|
public override Quad SelectionQuad => ScreenSpaceDrawQuad;
|
2020-04-23 08:52:54 +00:00
|
|
|
|
|
2021-06-15 04:20:33 +00:00
|
|
|
|
public override Vector2 ScreenSpaceSelectionPoint => head.ScreenSpaceDrawQuad.Centre;
|
2018-05-20 10:22:42 +00:00
|
|
|
|
}
|
|
|
|
|
}
|