Skip to content

Commit

Permalink
Merge pull request #30326 from jhk2601/barrel_roll_fix
Browse files Browse the repository at this point in the history
Fix cursor rotating with barrel roll mod active
  • Loading branch information
bdach authored Oct 21, 2024
2 parents 3111844 + 8349226 commit 22c3a25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions osu.Game.Rulesets.Osu/Mods/OsuModBarrelRoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
// See the LICENCE file in the repository root for full licence text.

using System;
using System.Diagnostics;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;

namespace osu.Game.Rulesets.Osu.Mods
{
Expand All @@ -25,5 +28,14 @@ public void ApplyToDrawableHitObject(DrawableHitObject d)
}
};
}

public override void Update(Playfield playfield)
{
base.Update(playfield);
OsuPlayfield osuPlayfield = (OsuPlayfield)playfield;
Debug.Assert(osuPlayfield.Cursor != null);

osuPlayfield.Cursor.ActiveCursor.Rotation = -CurrentRotation;
}
}
}
2 changes: 1 addition & 1 deletion osu.Game/Rulesets/Mods/ModBarrelRoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public abstract class ModBarrelRoll<TObject> : Mod, IUpdatableByPlayfield, IAppl

private PlayfieldAdjustmentContainer playfieldAdjustmentContainer = null!;

public void Update(Playfield playfield)
public virtual void Update(Playfield playfield)
{
playfieldAdjustmentContainer.Rotation = CurrentRotation = (Direction.Value == RotationDirection.Counterclockwise ? -1 : 1) * 360 * (float)(playfield.Time.Current / 60000 * SpinSpeed.Value);
}
Expand Down

0 comments on commit 22c3a25

Please sign in to comment.