Skip to content

Commit

Permalink
Adjust Laned Highlights to better represent timings
Browse files Browse the repository at this point in the history
Allows for better visual representation when adjusting time via snapping.
Hold notes also keep their full length
  • Loading branch information
LumpBloom7 committed Oct 31, 2023
1 parent 65307c1 commit 8b4001b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives;
Expand Down Expand Up @@ -60,6 +61,9 @@ protected override void Update()
updateSlideBodyHighlights();
}

[Resolved]
private SentakkiSnapGrid snapGrid { get; set; } = null!;

private void updateTapHighlight()
{
var slideTap = DrawableObject.SlideTaps.Child;
Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 8b4001b

Please sign in to comment.