1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 11:47:24 +08:00

Merge pull request #30326 from jhk2601/barrel_roll_fix

Fix cursor rotating with barrel roll mod active
This commit is contained in:
Bartłomiej Dach 2024-10-21 13:51:28 +02:00 committed by GitHub
commit 22c3a25575
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 1 deletions

View File

@ -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
{
@ -25,5 +28,14 @@ namespace osu.Game.Rulesets.Osu.Mods
}
};
}
public override void Update(Playfield playfield)
{
base.Update(playfield);
OsuPlayfield osuPlayfield = (OsuPlayfield)playfield;
Debug.Assert(osuPlayfield.Cursor != null);
osuPlayfield.Cursor.ActiveCursor.Rotation = -CurrentRotation;
}
}
}

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Mods
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);
}