mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
Merge pull request #29841 from bdach/replay-analysis-mod-woes
Fix several issues in interactions between playfield-altering mods and the replay analysis feature
This commit is contained in:
commit
a8365202d9
@ -44,7 +44,9 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
{
|
{
|
||||||
if (replayPlayer != null)
|
if (replayPlayer != null)
|
||||||
{
|
{
|
||||||
PlayfieldAdjustmentContainer.Add(new ReplayAnalysisOverlay(replayPlayer.Score.Replay));
|
ReplayAnalysisOverlay analysisOverlay;
|
||||||
|
PlayfieldAdjustmentContainer.Add(analysisOverlay = new ReplayAnalysisOverlay(replayPlayer.Score.Replay));
|
||||||
|
Overlays.Add(analysisOverlay.CreateProxy().With(p => p.Depth = float.NegativeInfinity));
|
||||||
replayPlayer.AddSettings(new ReplayAnalysisSettings(Config));
|
replayPlayer.AddSettings(new ReplayAnalysisSettings(Config));
|
||||||
|
|
||||||
cursorHideEnabled = Config.GetBindable<bool>(OsuRulesetSetting.ReplayCursorHideEnabled);
|
cursorHideEnabled = Config.GetBindable<bool>(OsuRulesetSetting.ReplayCursorHideEnabled);
|
||||||
|
@ -40,9 +40,11 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
public override string SettingDescription => $"{SpinSpeed.Value:N2} rpm {Direction.Value.GetDescription().ToLowerInvariant()}";
|
public override string SettingDescription => $"{SpinSpeed.Value:N2} rpm {Direction.Value.GetDescription().ToLowerInvariant()}";
|
||||||
|
|
||||||
|
private PlayfieldAdjustmentContainer playfieldAdjustmentContainer = null!;
|
||||||
|
|
||||||
public void Update(Playfield playfield)
|
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)
|
public void ApplyToDrawableRuleset(DrawableRuleset<TObject> drawableRuleset)
|
||||||
@ -52,7 +54,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
var playfieldSize = drawableRuleset.Playfield.DrawSize;
|
var playfieldSize = drawableRuleset.Playfield.DrawSize;
|
||||||
float minSide = MathF.Min(playfieldSize.X, playfieldSize.Y);
|
float minSide = MathF.Min(playfieldSize.X, playfieldSize.Y);
|
||||||
float maxSide = MathF.Max(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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,8 +83,6 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
|
|
||||||
flashlight.RelativeSizeAxes = Axes.Both;
|
flashlight.RelativeSizeAxes = Axes.Both;
|
||||||
flashlight.Colour = Color4.Black;
|
flashlight.Colour = Color4.Black;
|
||||||
// Flashlight mods should always draw above any other mod adding overlays.
|
|
||||||
flashlight.Depth = float.MinValue;
|
|
||||||
|
|
||||||
flashlight.Combo.BindTo(Combo);
|
flashlight.Combo.BindTo(Combo);
|
||||||
flashlight.GetPlayfieldScale = () => drawableRuleset.Playfield.Scale;
|
flashlight.GetPlayfieldScale = () => drawableRuleset.Playfield.Scale;
|
||||||
@ -95,6 +93,9 @@ namespace osu.Game.Rulesets.Mods
|
|||||||
// workaround for 1px gaps on the edges of the playfield which would sometimes show with "gameplay" screen scaling active.
|
// workaround for 1px gaps on the edges of the playfield which would sometimes show with "gameplay" screen scaling active.
|
||||||
Padding = new MarginPadding(-1),
|
Padding = new MarginPadding(-1),
|
||||||
Child = flashlight,
|
Child = flashlight,
|
||||||
|
// Flashlight mods should always draw above any other mod adding overlays.
|
||||||
|
// NegativeInfinity is not used to allow one more thing drawn on top (used in replay analysis overlay in osu!).
|
||||||
|
Depth = float.MinValue,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user