Skip to content

Commit

Permalink
Merge pull request #547 from LumpBloom7/fix-rewind-second-star-missing
Browse files Browse the repository at this point in the history
Fix second star disappearing after first use
  • Loading branch information
LumpBloom7 committed Jan 30, 2024
2 parents 4f78e77 + d54d1cc commit 2ccebc0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlide.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public partial class DrawableSlide : DrawableSentakkiHitObject
public Container<DrawableSlideBody> SlideBodies = null!;
public Container<DrawableSlideTap> SlideTaps = null!;

public new Slide HitObject => (Slide)base.HitObject;

public DrawableSlide()
: this(null)
{
Expand Down
15 changes: 11 additions & 4 deletions osu.Game.Rulesets.Sentakki/Objects/Drawables/DrawableSlideTap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ public partial class DrawableSlideTap : DrawableTap
{
protected override Drawable CreateTapRepresentation() => new SlideTapPiece();

protected new DrawableSlide ParentHitObject => (DrawableSlide)base.ParentHitObject;

public DrawableSlideTap()
: this(null)
{
Expand All @@ -18,6 +20,14 @@ public DrawableSlideTap(SlideTap? hitObject)
{
}

protected override void OnApply()
{
base.OnApply();

if (TapVisual is SlideTapPiece note)
note.SecondStar.Alpha = ParentHitObject.HitObject.SlideInfoList.Count > 1 ? 1 : 0;
}

protected override void UpdateInitialTransforms()
{
base.UpdateInitialTransforms();
Expand All @@ -29,10 +39,7 @@ protected override void UpdateInitialTransforms()
double spinDuration = baseline_spin_duration * (DrawableSentakkiRuleset?.GameplaySpeed ?? 1);

if (ParentHitObject is DrawableSlide slide)
{
spinDuration += ((Slide)slide.HitObject).SlideInfoList.FirstOrDefault()?.Duration ?? 1000;
note.SecondStar.Alpha = slide.SlideBodies.Count > 1 ? 1 : 0;
}
spinDuration += slide.HitObject.SlideInfoList.FirstOrDefault()?.Duration ?? 1000;

note.Stars.Spin(spinDuration, RotationDirection.Counterclockwise).Loop();
}
Expand Down

0 comments on commit 2ccebc0

Please sign in to comment.