1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 07:27:25 +08:00
osu-lazer/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNoteNoteOverlay.cs

44 lines
1.5 KiB
C#
Raw Normal View History

// 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.
2019-11-07 12:23:00 +08:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2019-11-07 12:23:00 +08:00
using osu.Game.Rulesets.Mania.Edit.Blueprints.Components;
using osu.Game.Rulesets.Mania.Objects.Drawables;
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
public class HoldNoteNoteOverlay : CompositeDrawable
{
private readonly HoldNoteSelectionBlueprint holdNoteBlueprint;
2019-11-07 12:23:00 +08:00
private readonly HoldNotePosition position;
public HoldNoteNoteOverlay(HoldNoteSelectionBlueprint holdNoteBlueprint, HoldNotePosition position)
{
this.holdNoteBlueprint = holdNoteBlueprint;
2019-11-07 12:23:00 +08:00
this.position = position;
InternalChild = new EditNotePiece { RelativeSizeAxes = Axes.X };
}
protected override void Update()
{
base.Update();
var drawableObject = holdNoteBlueprint.DrawableObject;
2019-11-07 12:31:06 +08:00
// Todo: This shouldn't exist, mania should not reference the drawable hitobject directly.
if (drawableObject.IsLoaded)
2019-11-07 12:31:06 +08:00
{
DrawableNote note = position == HoldNotePosition.Start ? (DrawableNote)drawableObject.Head : drawableObject.Tail;
2019-11-07 12:23:00 +08:00
2019-11-07 12:31:06 +08:00
Anchor = note.Anchor;
Origin = note.Origin;
2019-11-07 12:31:06 +08:00
Size = note.DrawSize;
Position = note.DrawPosition;
}
}
}
}