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,6 +26,9 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
base.Update();
// 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;
@ -34,6 +37,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
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;

View File

@ -54,6 +54,9 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
{
base.Update();
// 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
@ -62,6 +65,7 @@ namespace osu.Game.Rulesets.Mania.Edit.Blueprints
if (direction.Value == ScrollingDirection.Down)
Y -= DrawableObject.Tail.DrawHeight;
}
}
public override Quad SelectionQuad => ScreenSpaceDrawQuad;
}

View File

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