osu/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNoteNoteSelectionBluepr...

46 lines
1.6 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 04:23:00 +00:00
using osu.Framework.Graphics;
using osu.Game.Rulesets.Mania.Edit.Blueprints.Components;
using osu.Game.Rulesets.Mania.Objects.Drawables;
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
2019-11-07 04:23:00 +00:00
public class HoldNoteNoteSelectionBlueprint : ManiaSelectionBlueprint
{
2019-11-07 04:23:00 +00:00
protected new DrawableHoldNote DrawableObject => (DrawableHoldNote)base.DrawableObject;
private readonly HoldNotePosition position;
public HoldNoteNoteSelectionBlueprint(DrawableHoldNote holdNote, HoldNotePosition position)
: base(holdNote)
{
2019-11-07 04:23:00 +00:00
this.position = position;
InternalChild = new EditNotePiece { RelativeSizeAxes = Axes.X };
Select();
}
protected override void Update()
{
base.Update();
2019-11-07 04:31:06 +00:00
// Todo: This shouldn't exist, mania should not reference the drawable hitobject directly.
if (DrawableObject.IsLoaded)
{
2019-12-23 08:48:48 +00:00
DrawableNote note = position == HoldNotePosition.Start ? (DrawableNote)DrawableObject.Head : DrawableObject.Tail;
2019-11-07 04:23:00 +00:00
2019-11-07 04:31:06 +00:00
Anchor = note.Anchor;
Origin = note.Origin;
2019-11-07 04:31:06 +00:00
Size = note.DrawSize;
Position = note.DrawPosition;
}
}
// Todo: This is temporary, since the note masks don't do anything special yet. In the future they will handle input.
public override bool HandlePositionalInput => false;
}
}