1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-09 20:47:25 +08:00

Fix playfield skinning layer no longer correctly rotating with the playfield

Closes https://github.com/ppy/osu/issues/30353.

Regressed in
4a39873e2a.
This commit is contained in:
Bartłomiej Dach 2024-10-21 13:40:35 +02:00
parent 3111844809
commit e89a4561ab
No known key found for this signature in database
2 changed files with 12 additions and 8 deletions

View File

@ -65,18 +65,16 @@ namespace osu.Game.Rulesets.UI
/// </summary>
public override Playfield Playfield => playfield.Value;
private PlayfieldAdjustmentContainer playfieldAdjustmentContainer;
public override PlayfieldAdjustmentContainer PlayfieldAdjustmentContainer => playfieldAdjustmentContainer;
public override Container Overlays { get; } = new Container { RelativeSizeAxes = Axes.Both };
public override IAdjustableAudioComponent Audio => audioContainer;
private readonly AudioContainer audioContainer = new AudioContainer { RelativeSizeAxes = Axes.Both };
/// <summary>
/// A container which encapsulates the <see cref="Playfield"/> and provides any adjustments to
/// ensure correct scale and position.
/// </summary>
public virtual PlayfieldAdjustmentContainer PlayfieldAdjustmentContainer { get; private set; }
public override Container FrameStableComponents { get; } = new Container { RelativeSizeAxes = Axes.Both };
public override IFrameStableClock FrameStableClock => frameStabilityContainer;
@ -197,7 +195,7 @@ namespace osu.Game.Rulesets.UI
audioContainer.WithChild(KeyBindingInputManager
.WithChildren(new Drawable[]
{
PlayfieldAdjustmentContainer = CreatePlayfieldAdjustmentContainer()
playfieldAdjustmentContainer = CreatePlayfieldAdjustmentContainer()
.WithChild(Playfield),
Overlays
})),
@ -456,6 +454,12 @@ namespace osu.Game.Rulesets.UI
/// </summary>
public abstract Playfield Playfield { get; }
/// <summary>
/// A container which encapsulates the <see cref="Playfield"/> and provides any adjustments to
/// ensure correct scale and position.
/// </summary>
public abstract PlayfieldAdjustmentContainer PlayfieldAdjustmentContainer { get; }
/// <summary>
/// Content to be placed above hitobjects. Will be affected by frame stability and adjustments applied to <see cref="Audio"/>.
/// </summary>

View File

@ -252,7 +252,7 @@ namespace osu.Game.Screens.Play
PlayfieldSkinLayer.Position = ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft);
PlayfieldSkinLayer.Width = (ToLocalSpace(playfieldScreenSpaceDrawQuad.TopRight) - ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft)).Length;
PlayfieldSkinLayer.Height = (ToLocalSpace(playfieldScreenSpaceDrawQuad.BottomLeft) - ToLocalSpace(playfieldScreenSpaceDrawQuad.TopLeft)).Length;
PlayfieldSkinLayer.Rotation = drawableRuleset.Playfield.Rotation;
PlayfieldSkinLayer.Rotation = drawableRuleset.PlayfieldAdjustmentContainer.Rotation;
}
float? lowestTopScreenSpaceLeft = null;