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-04-13 09:19:50 +00:00
|
|
|
|
|
2024-06-19 11:18:56 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Bindables;
|
2022-05-12 10:26:34 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
2019-10-21 08:14:08 +00:00
|
|
|
|
using osu.Framework.Graphics.Primitives;
|
2024-06-19 11:18:56 +00:00
|
|
|
|
using osu.Game.Configuration;
|
2018-11-07 07:08:56 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles.Components;
|
2018-10-03 05:35:26 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2018-02-20 09:01:45 +00:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2019-10-21 08:14:08 +00:00
|
|
|
|
using osuTK;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2018-11-07 07:08:56 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles
|
2018-02-20 09:01:45 +00:00
|
|
|
|
{
|
2019-09-27 09:45:22 +00:00
|
|
|
|
public partial class HitCircleSelectionBlueprint : OsuSelectionBlueprint<HitCircle>
|
2018-02-20 09:01:45 +00:00
|
|
|
|
{
|
2019-10-21 08:14:08 +00:00
|
|
|
|
protected new DrawableHitCircle DrawableObject => (DrawableHitCircle)base.DrawableObject;
|
|
|
|
|
|
2019-10-01 10:33:08 +00:00
|
|
|
|
protected readonly HitCirclePiece CirclePiece;
|
2022-05-12 10:26:34 +00:00
|
|
|
|
private readonly HitCircleOverlapMarker marker;
|
2024-06-19 11:18:56 +00:00
|
|
|
|
private readonly Bindable<bool> showHitMarkers = new Bindable<bool>();
|
2019-09-27 09:45:22 +00:00
|
|
|
|
|
2021-05-13 10:53:32 +00:00
|
|
|
|
public HitCircleSelectionBlueprint(HitCircle circle)
|
|
|
|
|
: base(circle)
|
2018-02-20 09:01:45 +00:00
|
|
|
|
{
|
2022-05-12 10:26:34 +00:00
|
|
|
|
InternalChildren = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
marker = new HitCircleOverlapMarker(),
|
|
|
|
|
CirclePiece = new HitCirclePiece(),
|
|
|
|
|
};
|
2019-09-27 09:45:22 +00:00
|
|
|
|
}
|
|
|
|
|
|
2024-06-19 11:18:56 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuConfigManager config)
|
|
|
|
|
{
|
|
|
|
|
config.BindWith(OsuSetting.EditorShowHitMarkers, showHitMarkers);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
|
|
|
|
|
showHitMarkers.BindValueChanged(_ =>
|
|
|
|
|
{
|
|
|
|
|
if (!showHitMarkers.Value)
|
|
|
|
|
DrawableObject.RestoreHitAnimations();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2019-09-27 09:45:22 +00:00
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
2019-10-01 10:33:08 +00:00
|
|
|
|
CirclePiece.UpdateFrom(HitObject);
|
2022-05-12 10:26:34 +00:00
|
|
|
|
marker.UpdateFrom(HitObject);
|
2024-06-19 11:18:56 +00:00
|
|
|
|
|
|
|
|
|
if (showHitMarkers.Value)
|
|
|
|
|
DrawableObject.SuppressHitAnimations();
|
2018-02-20 09:01:45 +00:00
|
|
|
|
}
|
2019-10-21 08:14:08 +00:00
|
|
|
|
|
|
|
|
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => DrawableObject.HitArea.ReceivePositionalInputAt(screenSpacePos);
|
|
|
|
|
|
2021-01-18 07:57:36 +00:00
|
|
|
|
public override Quad SelectionQuad => CirclePiece.ScreenSpaceDrawQuad;
|
2018-02-20 09:01:45 +00:00
|
|
|
|
}
|
|
|
|
|
}
|