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-11-07 07:21:32 +00:00
|
|
|
|
|
2022-05-12 10:25:51 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2018-11-07 07:21:32 +00:00
|
|
|
|
using osu.Game.Rulesets.Edit;
|
2022-05-12 10:25:51 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects;
|
2022-05-12 10:42:35 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
|
2018-11-07 07:21:32 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2021-05-13 10:53:32 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2022-05-12 10:25:51 +00:00
|
|
|
|
using osu.Game.Screens.Edit;
|
2018-11-07 07:21:32 +00:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints
|
|
|
|
|
{
|
2021-05-13 10:53:32 +00:00
|
|
|
|
public abstract partial class OsuSelectionBlueprint<T> : HitObjectSelectionBlueprint<T>
|
2019-09-27 09:45:22 +00:00
|
|
|
|
where T : OsuHitObject
|
2018-11-07 07:21:32 +00:00
|
|
|
|
{
|
2022-05-12 10:25:51 +00:00
|
|
|
|
[Resolved]
|
|
|
|
|
private EditorClock editorClock { get; set; } = null!;
|
|
|
|
|
|
2021-05-13 10:53:32 +00:00
|
|
|
|
protected new DrawableOsuHitObject DrawableObject => (DrawableOsuHitObject)base.DrawableObject;
|
2018-11-07 07:21:32 +00:00
|
|
|
|
|
2020-05-27 04:40:16 +00:00
|
|
|
|
protected override bool AlwaysShowWhenSelected => true;
|
|
|
|
|
|
2022-05-12 14:37:29 +00:00
|
|
|
|
protected override bool ShouldBeAlive => base.ShouldBeAlive
|
2023-07-19 05:52:31 +00:00
|
|
|
|
|| (DrawableObject is not DrawableSpinner && ShowHitMarkers.Value && editorClock.CurrentTime >= Item.StartTime
|
|
|
|
|
&& editorClock.CurrentTime - Item.GetEndTime() < HitCircleOverlapMarker.FADE_OUT_EXTENSION);
|
|
|
|
|
|
2023-07-25 09:13:35 +00:00
|
|
|
|
public override bool IsSelectable =>
|
|
|
|
|
// Bypass fade out extension from hit markers for selection purposes.
|
2023-07-19 05:52:31 +00:00
|
|
|
|
// This is to match stable, where even when the afterimage hit markers are still visible, objects are not selectable.
|
|
|
|
|
base.ShouldBeAlive;
|
2022-05-12 10:25:51 +00:00
|
|
|
|
|
2021-05-13 10:53:32 +00:00
|
|
|
|
protected OsuSelectionBlueprint(T hitObject)
|
|
|
|
|
: base(hitObject)
|
2018-11-07 07:21:32 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|