mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 13:15:08 +08:00
Make holdnote notes update lazily
This commit is contained in:
parent
8141509a71
commit
8d42e45fd3
@ -1,15 +1,24 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Rulesets.Mania.Edit.Blueprints.Components;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
||||||
{
|
{
|
||||||
public class HoldNoteNoteSelectionBlueprint : NoteSelectionBlueprint
|
public class HoldNoteNoteSelectionBlueprint : ManiaSelectionBlueprint
|
||||||
{
|
{
|
||||||
public HoldNoteNoteSelectionBlueprint(DrawableNote note)
|
protected new DrawableHoldNote DrawableObject => (DrawableHoldNote)base.DrawableObject;
|
||||||
: base(note)
|
|
||||||
|
private readonly HoldNotePosition position;
|
||||||
|
|
||||||
|
public HoldNoteNoteSelectionBlueprint(DrawableHoldNote holdNote, HoldNotePosition position)
|
||||||
|
: base(holdNote)
|
||||||
{
|
{
|
||||||
|
this.position = position;
|
||||||
|
InternalChild = new EditNotePiece { RelativeSizeAxes = Axes.X };
|
||||||
|
|
||||||
Select();
|
Select();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17,10 +26,13 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
|||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
|
||||||
Anchor = DrawableObject.Anchor;
|
DrawableNote note = position == HoldNotePosition.Start ? DrawableObject.Head : DrawableObject.Tail;
|
||||||
Origin = DrawableObject.Origin;
|
|
||||||
|
|
||||||
Position = DrawableObject.DrawPosition;
|
Anchor = note.Anchor;
|
||||||
|
Origin = note.Origin;
|
||||||
|
|
||||||
|
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.
|
// Todo: This is temporary, since the note masks don't do anything special yet. In the future they will handle input.
|
||||||
|
11
osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePosition.cs
Normal file
11
osu.Game.Rulesets.Mania/Edit/Blueprints/HoldNotePosition.cs
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
||||||
|
{
|
||||||
|
public enum HoldNotePosition
|
||||||
|
{
|
||||||
|
Start,
|
||||||
|
End
|
||||||
|
}
|
||||||
|
}
|
@ -40,8 +40,8 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
|||||||
|
|
||||||
InternalChildren = new Drawable[]
|
InternalChildren = new Drawable[]
|
||||||
{
|
{
|
||||||
new HoldNoteNoteSelectionBlueprint(DrawableObject.Head),
|
new HoldNoteNoteSelectionBlueprint(DrawableObject, HoldNotePosition.Start),
|
||||||
new HoldNoteNoteSelectionBlueprint(DrawableObject.Tail),
|
new HoldNoteNoteSelectionBlueprint(DrawableObject, HoldNotePosition.End),
|
||||||
new BodyPiece
|
new BodyPiece
|
||||||
{
|
{
|
||||||
AccentColour = Color4.Transparent,
|
AccentColour = Color4.Transparent,
|
||||||
|
Loading…
Reference in New Issue
Block a user