From e5207167c810ea924fe27781ec1f31acb96a7a69 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sun, 8 Oct 2023 00:39:30 +0900 Subject: [PATCH] Rename `FailAnimation` to `FailAnimationContainer` --- ...{FailAnimation.cs => FailAnimationContainer.cs} | 6 +++--- osu.Game/Screens/Play/Player.cs | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) rename osu.Game/Screens/Play/{FailAnimation.cs => FailAnimationContainer.cs} (97%) diff --git a/osu.Game/Screens/Play/FailAnimation.cs b/osu.Game/Screens/Play/FailAnimationContainer.cs similarity index 97% rename from osu.Game/Screens/Play/FailAnimation.cs rename to osu.Game/Screens/Play/FailAnimationContainer.cs index 57bdad079e..821c67e3cb 100644 --- a/osu.Game/Screens/Play/FailAnimation.cs +++ b/osu.Game/Screens/Play/FailAnimationContainer.cs @@ -27,10 +27,10 @@ using osuTK.Graphics; namespace osu.Game.Screens.Play { /// - /// Manage the animation to be applied when a player fails. + /// Manage the animation to be applied when a player fails. Applies the animation to children. /// Single use and automatically disposed after use. /// - public partial class FailAnimation : Container + public partial class FailAnimationContainer : Container { public Action? OnComplete; @@ -66,7 +66,7 @@ namespace osu.Game.Screens.Play /// public BackgroundScreen? Background { private get; set; } - public FailAnimation(DrawableRuleset drawableRuleset) + public FailAnimationContainer(DrawableRuleset drawableRuleset) { this.drawableRuleset = drawableRuleset; diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 60806a73c5..ac9ce11cb5 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -257,7 +257,7 @@ namespace osu.Game.Screens.Play rulesetSkinProvider.AddRange(new Drawable[] { - failAnimationLayer = new FailAnimation(DrawableRuleset) + failAnimationContainer = new FailAnimationContainer(DrawableRuleset) { OnComplete = onFailComplete, Children = new[] @@ -310,7 +310,7 @@ namespace osu.Game.Screens.Play // 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.) // we may want to limit this in the future to disallow rulesets from outright replacing elements the user expects to be there. - failAnimationLayer.Add(createOverlayComponents(Beatmap.Value)); + failAnimationContainer.Add(createOverlayComponents(Beatmap.Value)); if (!DrawableRuleset.AllowGameplayOverlays) { @@ -587,7 +587,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 (ValidForResume && GameplayState.HasFailed) { - failAnimationLayer.FinishTransforms(true); + failAnimationContainer.FinishTransforms(true); return; } @@ -888,7 +888,7 @@ namespace osu.Game.Screens.Play protected FailOverlay FailOverlay { get; private set; } - private FailAnimation failAnimationLayer; + private FailAnimationContainer failAnimationContainer; private bool onFail() { @@ -913,7 +913,7 @@ namespace osu.Game.Screens.Play if (PauseOverlay.State.Value == Visibility.Visible) PauseOverlay.Hide(); - failAnimationLayer.Start(); + failAnimationContainer.Start(); if (GameplayState.Mods.OfType().Any(m => m.RestartOnFail)) Restart(true); @@ -1044,7 +1044,7 @@ namespace osu.Game.Screens.Play b.StoryboardReplacesBackground.BindTo(storyboardReplacesBackground); - failAnimationLayer.Background = b; + failAnimationContainer.Background = b; }); HUDOverlay.IsPlaying.BindTo(localUserPlaying); @@ -1099,7 +1099,7 @@ namespace osu.Game.Screens.Play screenSuspension?.RemoveAndDisposeImmediately(); // Eagerly clean these up as disposal of child components is asynchronous and may leave sounds playing beyond user expectations. - failAnimationLayer?.Stop(); + failAnimationContainer?.Stop(); PauseOverlay?.StopAllSamples(); if (LoadedBeatmapSuccessfully)