From 9637d3f1f2d151a37fa3725fe20317790faa73d4 Mon Sep 17 00:00:00 2001 From: Derrick Timmermans Date: Tue, 31 Oct 2023 13:36:11 +0100 Subject: [PATCH] Adjust Laned Highlights to better represent timings Allows for better visual representation when adjusting time via snapping. Hold notes also keep their full length --- .../Edit/Blueprints/Holds/HoldSelectionBlueprint.cs | 8 ++++++-- .../Edit/Blueprints/Slides/SlideSelectionBlueprint.cs | 6 +++++- .../Edit/Blueprints/Taps/TapSelectionBlueprint.cs | 6 +++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Holds/HoldSelectionBlueprint.cs b/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Holds/HoldSelectionBlueprint.cs index 656a5e91a..d9b1c2503 100644 --- a/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Holds/HoldSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Holds/HoldSelectionBlueprint.cs @@ -1,4 +1,5 @@ using System; +using osu.Framework.Allocation; using osu.Framework.Graphics.Primitives; using osu.Game.Rulesets.Sentakki.Objects; using osu.Game.Rulesets.Sentakki.Objects.Drawables; @@ -19,13 +20,16 @@ public HoldSelectionBlueprint(Hold hitObject) InternalChild = highlight = new HoldHighlight(); } + [Resolved] + private SentakkiSnapGrid snapGrid { get; set; } = null!; + protected override void Update() { base.Update(); highlight.Rotation = DrawableObject.HitObject.Lane.GetRotationForLane(); - highlight.Note.Y = Math.Max(DrawableObject.NoteBody.Y, -SentakkiPlayfield.INTERSECTDISTANCE); - highlight.Note.Height = DrawableObject.NoteBody.Height; + highlight.Note.Y = -snapGrid.GetDistanceRelativeToCurrentTime(HitObject.StartTime, SentakkiPlayfield.NOTESTARTDISTANCE); + highlight.Note.Height = -snapGrid.GetDistanceRelativeToCurrentTime(HitObject.EndTime, SentakkiPlayfield.NOTESTARTDISTANCE) - highlight.Note.Y; highlight.Note.Scale = DrawableObject.NoteBody.Scale; } diff --git a/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Slides/SlideSelectionBlueprint.cs b/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Slides/SlideSelectionBlueprint.cs index 0554f78e2..6462c940c 100644 --- a/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Slides/SlideSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Slides/SlideSelectionBlueprint.cs @@ -1,4 +1,5 @@ using System; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; @@ -60,6 +61,9 @@ protected override void Update() updateSlideBodyHighlights(); } + [Resolved] + private SentakkiSnapGrid snapGrid { get; set; } = null!; + private void updateTapHighlight() { var slideTap = DrawableObject.SlideTaps.Child; @@ -68,7 +72,7 @@ private void updateTapHighlight() tapHighlight.SlideTapPiece.Stars.Rotation = ((SlideTapPiece)slideTap.TapVisual).Stars.Rotation; tapHighlight.SlideTapPiece.SecondStar.Alpha = ((SlideTapPiece)slideTap.TapVisual).SecondStar.Alpha; tapHighlight.Rotation = DrawableObject.HitObject.Lane.GetRotationForLane(); - tapHighlight.SlideTapPiece.Y = Math.Max(slideTap.TapVisual.Y, -SentakkiPlayfield.INTERSECTDISTANCE); + tapHighlight.SlideTapPiece.Y = -snapGrid.GetDistanceRelativeToCurrentTime(DrawableObject.HitObject.StartTime, SentakkiPlayfield.NOTESTARTDISTANCE); } private void updateSlideBodyHighlights() diff --git a/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Taps/TapSelectionBlueprint.cs b/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Taps/TapSelectionBlueprint.cs index 9ce5b628d..744cad330 100644 --- a/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Taps/TapSelectionBlueprint.cs +++ b/osu.Game.Rulesets.Sentakki/Edit/Blueprints/Taps/TapSelectionBlueprint.cs @@ -1,4 +1,5 @@ using System; +using osu.Framework.Allocation; using osu.Framework.Graphics.Primitives; using osu.Game.Rulesets.Sentakki.Objects; using osu.Game.Rulesets.Sentakki.Objects.Drawables; @@ -19,12 +20,15 @@ public TapSelectionBlueprint(Tap hitObject) InternalChild = highlight = new TapHighlight(); } + [Resolved] + private SentakkiSnapGrid snapGrid { get; set; } = null!; + protected override void Update() { base.Update(); highlight.Rotation = DrawableObject.HitObject.Lane.GetRotationForLane(); - highlight.Note.Y = Math.Max(DrawableObject.TapVisual.Y, -SentakkiPlayfield.INTERSECTDISTANCE); + highlight.Note.Y = -snapGrid.GetDistanceRelativeToCurrentTime(DrawableObject.HitObject.StartTime, SentakkiPlayfield.NOTESTARTDISTANCE); highlight.Note.Scale = DrawableObject.TapVisual.Scale; }