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-11-07 15:21:32 +08:00
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2018-11-13 15:42:40 +08:00
|
|
|
using osu.Framework.Allocation;
|
2018-11-12 16:18:58 +08:00
|
|
|
using osu.Framework.Graphics;
|
2018-11-07 15:21:32 +08:00
|
|
|
using osu.Game.Rulesets.Edit;
|
2021-05-13 18:53:32 +08:00
|
|
|
using osu.Game.Rulesets.Mania.Objects;
|
2021-06-15 12:20:33 +08:00
|
|
|
using osu.Game.Rulesets.Mania.UI;
|
2021-06-17 09:07:52 +08:00
|
|
|
using osu.Game.Rulesets.UI;
|
2018-11-13 15:42:40 +08:00
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
2018-11-07 15:21:32 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Edit.Blueprints
|
|
|
|
{
|
2021-05-13 18:53:32 +08:00
|
|
|
public abstract class ManiaSelectionBlueprint<T> : HitObjectSelectionBlueprint<T>
|
|
|
|
where T : ManiaHitObject
|
2018-11-07 15:21:32 +08:00
|
|
|
{
|
2021-06-15 12:20:33 +08:00
|
|
|
[Resolved]
|
2021-06-17 09:07:52 +08:00
|
|
|
private Playfield playfield { get; set; }
|
2018-11-26 10:34:25 +08:00
|
|
|
|
2018-11-13 15:42:40 +08:00
|
|
|
[Resolved]
|
|
|
|
private IScrollingInfo scrollingInfo { get; set; }
|
|
|
|
|
2021-06-17 09:07:52 +08:00
|
|
|
protected ScrollingHitObjectContainer HitObjectContainer => ((ManiaPlayfield)playfield).GetColumn(HitObject.Column).HitObjectContainer;
|
2021-06-15 12:20:33 +08:00
|
|
|
|
2021-05-13 18:53:32 +08:00
|
|
|
protected ManiaSelectionBlueprint(T hitObject)
|
|
|
|
: base(hitObject)
|
2018-11-07 15:21:32 +08:00
|
|
|
{
|
2018-11-12 16:18:58 +08:00
|
|
|
RelativeSizeAxes = Axes.None;
|
2018-11-07 15:21:32 +08:00
|
|
|
}
|
|
|
|
|
2018-11-13 14:45:06 +08:00
|
|
|
protected override void Update()
|
|
|
|
{
|
|
|
|
base.Update();
|
|
|
|
|
2021-06-15 12:20:33 +08:00
|
|
|
var anchor = scrollingInfo.Direction.Value == ScrollingDirection.Up ? Anchor.TopCentre : Anchor.BottomCentre;
|
|
|
|
Anchor = Origin = anchor;
|
|
|
|
foreach (var child in InternalChildren)
|
|
|
|
child.Anchor = child.Origin = anchor;
|
2018-11-26 10:34:25 +08:00
|
|
|
|
2021-06-15 12:20:33 +08:00
|
|
|
Position = Parent.ToLocalSpace(HitObjectContainer.ScreenSpacePositionAtTime(HitObject.StartTime)) - AnchorPosition;
|
|
|
|
Width = HitObjectContainer.DrawWidth;
|
2018-11-26 10:47:48 +08:00
|
|
|
}
|
2018-11-07 15:21:32 +08:00
|
|
|
}
|
|
|
|
}
|