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