1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Add temporary fix for null references

This commit is contained in:
smoogipoo 2019-11-07 13:31:06 +09:00
parent 8d42e45fd3
commit 1f9f03dc66
3 changed files with 22 additions and 12 deletions

View File

@ -26,13 +26,17 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
base.Update();
DrawableNote note = position == HoldNotePosition.Start ? DrawableObject.Head : DrawableObject.Tail;
// Todo: This shouldn't exist, mania should not reference the drawable hitobject directly.
if (DrawableObject.IsLoaded)
{
DrawableNote note = position == HoldNotePosition.Start ? DrawableObject.Head : DrawableObject.Tail;
Anchor = note.Anchor;
Origin = note.Origin;
Anchor = note.Anchor;
Origin = note.Origin;
Size = note.DrawSize;
Position = note.DrawPosition;
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.

View File

@ -54,13 +54,17 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
base.Update();
Size = DrawableObject.DrawSize + new Vector2(0, DrawableObject.Tail.DrawHeight);
// Todo: This shouldn't exist, mania should not reference the drawable hitobject directly.
if (DrawableObject.IsLoaded)
{
Size = DrawableObject.DrawSize + new Vector2(0, DrawableObject.Tail.DrawHeight);
// This is a side-effect of not matching the hitobject's anchors/origins, which is kinda hard to do
// When scrolling upwards our origin is already at the top of the head note (which is the intended location),
// but when scrolling downwards our origin is at the _bottom_ of the tail note (where we need to be at the _top_ of the tail note)
if (direction.Value == ScrollingDirection.Down)
Y -= DrawableObject.Tail.DrawHeight;
// This is a side-effect of not matching the hitobject's anchors/origins, which is kinda hard to do
// When scrolling upwards our origin is already at the top of the head note (which is the intended location),
// but when scrolling downwards our origin is at the _bottom_ of the tail note (where we need to be at the _top_ of the tail note)
if (direction.Value == ScrollingDirection.Down)
Y -= DrawableObject.Tail.DrawHeight;
}
}
public override Quad SelectionQuad => ScreenSpaceDrawQuad;

View File

@ -19,7 +19,9 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
base.Update();
Size = DrawableObject.DrawSize;
// Todo: This shouldn't exist, mania should not reference the drawable hitobject directly.
if (DrawableObject.IsLoaded)
Size = DrawableObject.DrawSize;
}
}
}