Split hit explosion positioning from column

This commit is contained in:
smoogipoo
2020-04-01 19:19:32 +09:00
parent beb1f037e9
commit 94031b57ea
5 changed files with 64 additions and 38 deletions

View File

@ -3,7 +3,6 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Mania.Objects.Drawables.Pieces;
using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.UI.Scrolling;
using osu.Game.Skinning;
@ -12,7 +11,7 @@ namespace osu.Game.Rulesets.Mania.UI.Components
{
public class ColumnHitObjectArea : HitObjectArea
{
public readonly Container<HitExplosion> Explosions;
public readonly Container<Drawable> Explosions;
private readonly Drawable hitTarget;
public ColumnHitObjectArea(HitObjectContainer hitObjectContainer)
@ -25,7 +24,7 @@ namespace osu.Game.Rulesets.Mania.UI.Components
RelativeSizeAxes = Axes.X,
Depth = 1
},
Explosions = new Container<HitExplosion>
Explosions = new Container<Drawable>
{
RelativeSizeAxes = Axes.Both,
Depth = -1,
@ -38,15 +37,9 @@ namespace osu.Game.Rulesets.Mania.UI.Components
base.UpdateHitPosition();
if (Direction.Value == ScrollingDirection.Up)
{
hitTarget.Anchor = hitTarget.Origin = Anchor.TopLeft;
Explosions.Padding = new MarginPadding { Top = DefaultNotePiece.NOTE_HEIGHT / 2 };
}
else
{
hitTarget.Anchor = hitTarget.Origin = Anchor.BottomLeft;
Explosions.Padding = new MarginPadding { Bottom = DefaultNotePiece.NOTE_HEIGHT / 2 };
}
}
}
}