2021-06-22 09:39:32 +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.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-06-22 09:39:32 +08:00
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
|
|
using osu.Game.Rulesets.Edit;
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
|
|
|
using osuTK;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Catch.Edit.Blueprints
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
public abstract partial class CatchSelectionBlueprint<THitObject> : HitObjectSelectionBlueprint<THitObject>
|
2021-06-22 09:39:32 +08:00
|
|
|
where THitObject : CatchHitObject
|
|
|
|
{
|
2021-07-07 20:01:55 +08:00
|
|
|
protected override bool AlwaysShowWhenSelected => true;
|
|
|
|
|
2021-06-22 09:39:32 +08:00
|
|
|
public override Vector2 ScreenSpaceSelectionPoint
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2021-07-19 12:33:46 +08:00
|
|
|
Vector2 position = CatchHitObjectUtils.GetStartPosition(HitObjectContainer, HitObject);
|
|
|
|
return HitObjectContainer.ToScreenSpace(position + new Vector2(0, HitObjectContainer.DrawHeight));
|
2021-06-22 09:39:32 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => SelectionQuad.Contains(screenSpacePos);
|
|
|
|
|
2021-06-23 09:18:44 +08:00
|
|
|
protected ScrollingHitObjectContainer HitObjectContainer => (ScrollingHitObjectContainer)playfield.HitObjectContainer;
|
|
|
|
|
|
|
|
[Resolved]
|
|
|
|
private Playfield playfield { get; set; }
|
|
|
|
|
2021-06-22 09:39:32 +08:00
|
|
|
protected CatchSelectionBlueprint(THitObject hitObject)
|
|
|
|
: base(hitObject)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|