1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-24 05:42:55 +08:00
osu-lazer/osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNoteNoteSelectionBlueprint.cs

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 12:23:00 +08: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 12:23:00 +08:00
public class HoldNoteNoteSelectionBlueprint : ManiaSelectionBlueprint
{
2019-11-07 12:23:00 +08:00
protected new DrawableHoldNote DrawableObject => (DrawableHoldNote)base.DrawableObject;
private readonly HoldNotePosition position;
public HoldNoteNoteSelectionBlueprint(DrawableHoldNote holdNote, HoldNotePosition position)
: base(holdNote)
{
2019-11-07 12:23:00 +08:00
this.position = position;
InternalChild = new EditNotePiece { RelativeSizeAxes = Axes.X };
Select();
}
protected override void Update()
{
base.Update();
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-12-23 16:48:48 +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;
}
}
// 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;
}
}