1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-27 05:01:22 +08:00

Fix replay analysis overlay not rotating with Barrel Roll enabled

Closes https://github.com/ppy/osu/issues/29839.
This commit is contained in:
Bartłomiej Dach
2024-09-11 15:54:30 +02:00
Unverified
parent b78ef81bf1
commit 4a39873e2a
2 changed files with 8 additions and 3 deletions
@@ -44,7 +44,8 @@ namespace osu.Game.Rulesets.Osu.UI
{
if (replayPlayer != null)
{
PlayfieldAdjustmentContainer.Add(new ReplayAnalysisOverlay(replayPlayer.Score.Replay));
ReplayAnalysisOverlay analysisOverlay;
PlayfieldAdjustmentContainer.Add(analysisOverlay = new ReplayAnalysisOverlay(replayPlayer.Score.Replay));
replayPlayer.AddSettings(new ReplayAnalysisSettings(Config));
cursorHideEnabled = Config.GetBindable<bool>(OsuRulesetSetting.ReplayCursorHideEnabled);
+6 -2
View File
@@ -40,9 +40,11 @@ namespace osu.Game.Rulesets.Mods
public override string SettingDescription => $"{SpinSpeed.Value:N2} rpm {Direction.Value.GetDescription().ToLowerInvariant()}";
private PlayfieldAdjustmentContainer playfieldAdjustmentContainer = null!;
public void Update(Playfield playfield)
{
playfield.Rotation = CurrentRotation = (Direction.Value == RotationDirection.Counterclockwise ? -1 : 1) * 360 * (float)(playfield.Time.Current / 60000 * SpinSpeed.Value);
playfieldAdjustmentContainer.Rotation = CurrentRotation = (Direction.Value == RotationDirection.Counterclockwise ? -1 : 1) * 360 * (float)(playfield.Time.Current / 60000 * SpinSpeed.Value);
}
public void ApplyToDrawableRuleset(DrawableRuleset<TObject> drawableRuleset)
@@ -52,7 +54,9 @@ namespace osu.Game.Rulesets.Mods
var playfieldSize = drawableRuleset.Playfield.DrawSize;
float minSide = MathF.Min(playfieldSize.X, playfieldSize.Y);
float maxSide = MathF.Max(playfieldSize.X, playfieldSize.Y);
drawableRuleset.Playfield.Scale = new Vector2(minSide / maxSide);
playfieldAdjustmentContainer = drawableRuleset.PlayfieldAdjustmentContainer;
playfieldAdjustmentContainer.Scale = new Vector2(minSide / maxSide);
}
}
}