Fix incorrect nesting

This commit is contained in:
Dean Herbert
2021-10-15 19:35:08 +09:00
parent 66f3370a19
commit b08743342b

View File

@ -230,17 +230,32 @@ namespace osu.Game.Screens.Play
// this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources. // this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
GameplayClockContainer.Add(rulesetSkinProvider); GameplayClockContainer.Add(rulesetSkinProvider);
rulesetSkinProvider.AddRange(new[] rulesetSkinProvider.AddRange(new Drawable[]
{
failAnimationLayer = new FailAnimation(DrawableRuleset)
{
OnComplete = onFailComplete,
Children = new[]
{ {
// underlay and gameplay should have access to the skinning sources. // underlay and gameplay should have access to the skinning sources.
createUnderlayComponents(), createUnderlayComponents(),
createGameplayComponents(Beatmap.Value, playableBeatmap) createGameplayComponents(Beatmap.Value, playableBeatmap)
}
},
FailOverlay = new FailOverlay
{
OnRetry = Restart,
OnQuit = () => PerformExit(true),
}
}); });
// add the overlay components as a separate step as they proxy some elements from the above underlay/gameplay components. // add the overlay components as a separate step as they proxy some elements from the above underlay/gameplay components.
// also give the overlays the ruleset skin provider to allow rulesets to potentially override HUD elements (used to disable combo counters etc.) // also give the overlays the ruleset skin provider to allow rulesets to potentially override HUD elements (used to disable combo counters etc.)
// we may want to limit this in the future to disallow rulesets from outright replacing elements the user expects to be there. // we may want to limit this in the future to disallow rulesets from outright replacing elements the user expects to be there.
rulesetSkinProvider.Add(createOverlayComponents(Beatmap.Value)); failAnimationLayer.AddRange(new[]
{
createOverlayComponents(Beatmap.Value),
});
if (!DrawableRuleset.AllowGameplayOverlays) if (!DrawableRuleset.AllowGameplayOverlays)
{ {
@ -339,7 +354,7 @@ namespace osu.Game.Screens.Play
var container = new Container var container = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new[]
{ {
new HotkeyExitOverlay new HotkeyExitOverlay
{ {
@ -351,11 +366,6 @@ namespace osu.Game.Screens.Play
PerformExit(false); PerformExit(false);
}, },
}, },
failAnimation = new FailAnimation(DrawableRuleset)
{
OnComplete = onFailComplete,
Children = new[]
{
DimmableStoryboard.OverlayLayerContainer.CreateProxy(), DimmableStoryboard.OverlayLayerContainer.CreateProxy(),
BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor) BreakOverlay = new BreakOverlay(working.Beatmap.BeatmapInfo.LetterboxInBreaks, ScoreProcessor)
{ {
@ -397,14 +407,7 @@ namespace osu.Game.Screens.Play
OnRetry = Restart, OnRetry = Restart,
OnQuit = () => PerformExit(true), OnQuit = () => PerformExit(true),
}, },
}
}, },
FailOverlay = new FailOverlay
{
OnRetry = Restart,
OnQuit = () => PerformExit(true),
}
}
}; };
if (!Configuration.AllowSkipping || !DrawableRuleset.AllowGameplayOverlays) if (!Configuration.AllowSkipping || !DrawableRuleset.AllowGameplayOverlays)
@ -547,7 +550,7 @@ namespace osu.Game.Screens.Play
// if the fail animation is currently in progress, accelerate it (it will show the pause dialog on completion). // if the fail animation is currently in progress, accelerate it (it will show the pause dialog on completion).
if (ValidForResume && HasFailed) if (ValidForResume && HasFailed)
{ {
failAnimation.FinishTransforms(true); failAnimationLayer.FinishTransforms(true);
return; return;
} }
@ -772,7 +775,7 @@ namespace osu.Game.Screens.Play
protected FailOverlay FailOverlay { get; private set; } protected FailOverlay FailOverlay { get; private set; }
private FailAnimation failAnimation; private FailAnimation failAnimationLayer;
private bool onFail() private bool onFail()
{ {
@ -788,7 +791,7 @@ namespace osu.Game.Screens.Play
if (PauseOverlay.State.Value == Visibility.Visible) if (PauseOverlay.State.Value == Visibility.Visible)
PauseOverlay.Hide(); PauseOverlay.Hide();
failAnimation.Start(); failAnimationLayer.Start();
if (GameplayState.Mods.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail)) if (GameplayState.Mods.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
Restart(); Restart();
@ -962,7 +965,7 @@ namespace osu.Game.Screens.Play
public override bool OnExiting(IScreen next) public override bool OnExiting(IScreen next)
{ {
screenSuspension?.RemoveAndDisposeImmediately(); screenSuspension?.RemoveAndDisposeImmediately();
failAnimation?.RemoveAndDisposeImmediately(); failAnimationLayer?.RemoveAndDisposeImmediately();
// if arriving here and the results screen preparation task hasn't run, it's safe to say the user has not completed the beatmap. // if arriving here and the results screen preparation task hasn't run, it's safe to say the user has not completed the beatmap.
if (prepareScoreForDisplayTask == null) if (prepareScoreForDisplayTask == null)