2019-01-24 16:43:03 +08:00
|
|
|
|
// 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.
|
2018-06-07 20:40:12 +08:00
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2018-06-07 20:40:12 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2018-09-21 13:35:50 +08:00
|
|
|
|
using osu.Game.Rulesets.UI;
|
2018-06-07 20:40:12 +08:00
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
2020-03-31 11:17:44 +08:00
|
|
|
|
using osu.Game.Skinning;
|
2018-06-07 20:40:12 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.UI.Components
|
|
|
|
|
{
|
2020-04-01 17:00:17 +08:00
|
|
|
|
public class ColumnHitObjectArea : HitObjectArea
|
2018-06-07 20:40:12 +08:00
|
|
|
|
{
|
2020-04-02 14:57:50 +08:00
|
|
|
|
public readonly Container Explosions;
|
2020-05-18 16:47:47 +08:00
|
|
|
|
|
|
|
|
|
public readonly Container UnderlayElements;
|
|
|
|
|
|
2019-12-29 23:37:28 +08:00
|
|
|
|
private readonly Drawable hitTarget;
|
2018-06-07 20:40:12 +08:00
|
|
|
|
|
2022-02-02 04:42:58 +08:00
|
|
|
|
public ColumnHitObjectArea(HitObjectContainer hitObjectContainer)
|
2020-04-01 17:00:17 +08:00
|
|
|
|
: base(hitObjectContainer)
|
2018-06-07 20:40:12 +08:00
|
|
|
|
{
|
2020-04-01 17:00:17 +08:00
|
|
|
|
AddRangeInternal(new[]
|
2018-06-07 20:40:12 +08:00
|
|
|
|
{
|
2020-05-18 16:47:47 +08:00
|
|
|
|
UnderlayElements = new Container
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Depth = 2,
|
|
|
|
|
},
|
2022-11-09 15:04:56 +08:00
|
|
|
|
hitTarget = new SkinnableDrawable(new ManiaSkinComponentLookup(ManiaSkinComponents.HitTarget), _ => new DefaultHitTarget())
|
2018-06-07 20:40:12 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
2020-04-01 17:00:17 +08:00
|
|
|
|
Depth = 1
|
2018-06-07 20:40:12 +08:00
|
|
|
|
},
|
2020-04-02 14:57:50 +08:00
|
|
|
|
Explosions = new Container
|
2020-04-01 17:00:17 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Depth = -1,
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-03-31 11:17:44 +08:00
|
|
|
|
}
|
2019-12-28 13:48:10 +08:00
|
|
|
|
|
2020-04-01 17:00:17 +08:00
|
|
|
|
protected override void UpdateHitPosition()
|
2020-03-31 11:17:44 +08:00
|
|
|
|
{
|
2020-04-01 17:00:17 +08:00
|
|
|
|
base.UpdateHitPosition();
|
2019-12-28 13:48:10 +08:00
|
|
|
|
|
2020-04-01 17:00:17 +08:00
|
|
|
|
if (Direction.Value == ScrollingDirection.Up)
|
2020-03-31 11:17:44 +08:00
|
|
|
|
hitTarget.Anchor = hitTarget.Origin = Anchor.TopLeft;
|
|
|
|
|
else
|
|
|
|
|
hitTarget.Anchor = hitTarget.Origin = Anchor.BottomLeft;
|
2018-06-07 20:40:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|